mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 23:36:08 -06:00
fixed media field
This commit is contained in:
parent
853f629ffb
commit
76b515a1b3
@ -10,4 +10,5 @@ return [
|
|||||||
'uploading' => 'Uploading',
|
'uploading' => 'Uploading',
|
||||||
'loading' => 'Loading',
|
'loading' => 'Loading',
|
||||||
'error_upload' => 'There was a problem uploading the file.',
|
'error_upload' => 'There was a problem uploading the file.',
|
||||||
|
'error_upload_docs' => 'There is no document upload support. Please contact your system administrator!',
|
||||||
];
|
];
|
||||||
|
|||||||
@ -10,4 +10,5 @@ return [
|
|||||||
'uploading' => 'Yükleme',
|
'uploading' => 'Yükleme',
|
||||||
'loading' => 'Yükleniyor',
|
'loading' => 'Yükleniyor',
|
||||||
'error_upload' => 'Dosyayı yüklerken bir sorun oluştu.',
|
'error_upload' => 'Dosyayı yüklerken bir sorun oluştu.',
|
||||||
|
'error_upload_docs' => 'Döküman yükleme desteği bulunmamaktadır.Lütfen sistem yöneticiniz ile iletişim kurunuz!',
|
||||||
];
|
];
|
||||||
|
|||||||
@ -50,13 +50,14 @@ class UploadController extends AdminController
|
|||||||
|
|
||||||
public function upload()
|
public function upload()
|
||||||
{
|
{
|
||||||
$doc_folder = app(FolderRepositoryInterface::class)->findBySlug('ads_documents')->id;
|
|
||||||
$mimes = explode('/', $this->request->file('upload')->getMimeType());
|
$mimes = explode('/', $this->request->file('upload')->getMimeType());
|
||||||
|
|
||||||
if ($mimes[0] == 'image') {
|
if ($mimes[0] == 'image') {
|
||||||
$file = $this->uploader->upload($this->request->file('upload'), $this->folders->find($this->request->get('folder')));
|
$file = $this->uploader->upload($this->request->file('upload'), $this->folders->find($this->request->get('folder')));
|
||||||
|
} else if ($doc_folder = app(FolderRepositoryInterface::class)->findBySlug('ads_documentsssssss')) {
|
||||||
|
$file = $this->uploader->upload($this->request->file('upload'), $doc_folder);
|
||||||
} else {
|
} else {
|
||||||
$file = $this->uploader->upload($this->request->file('upload'), $this->folders->find($doc_folder));
|
return $this->response->json(['error' => trans('visiosoft.field_type.media::message.error_upload_docs')], 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($file) {
|
if ($file) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user