Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Can't upload image #7

Open
raymondugv opened this issue Apr 20, 2020 · 19 comments
Open

Can't upload image #7

raymondugv opened this issue Apr 20, 2020 · 19 comments
Labels
invalid This doesn't seem right question Further information is requested

Comments

@raymondugv
Copy link

Hi there,

I was struggling to find the way to upload the image through the file manager, but it seems having these problem.

image
I've this returned by the browser, and on the view, it displayed like this
image

It's seems like the file is not saved in to the directory.

These are my configuration.
image

Could you please help me to find out what is happening with it?.

Thank you in advance.

@Kwaadpepper
Copy link
Owner

I just installed with the last laravel version it is working.
As for default config it is :

$upload_dir = 'uploads/files/';
$thumbs_upload_dir = 'thumbs/';
$current_path = 'uploads/files/';
$thumbs_base_path = 'thumbs/';

Please note that this library is an adaptation to the original library which is outdated.
Therefore, don't try to put files in Laravel storage as it is not supported.

I tried to adapt the underlying file system to use Laravel Storage components but the original code is such a pain in the ass. It is very outdated.

So the only thing you can do is use .htaccess to deny access in public/uploads and public/thumbs as the original library required

As for your issue, you cannot put thumbs folder in the upload folder.

Try this

$upload_dir = 'storage/uploads/files/';
$thumbs_upload_dir = 'storage/thumbs/';
$current_path = 'storage/uploads/files/';
$thumbs_base_path = 'storage/thumbs/';

don't forget to create that folder with right permissions and owner
mkdir public/storage/uploads/files

If you wish to use Laravel Storage mechanism you could try another much up to date or hit your head to the wall trying to rewrite Responsive File Manager.
As for me I am working on a new file manager project because of this.

@Kwaadpepper Kwaadpepper added invalid This doesn't seem right question Further information is requested labels Apr 20, 2020
@raymondugv
Copy link
Author

Hi @Kwaadpepper ,

Thank you for helping.
I've tried but it didn't work.

Any idea about this matter?.

@Kwaadpepper
Copy link
Owner

Are you using the last version ? 0.0.7
Have you followed the config I gave you ?
Does it change the message error ?

Here is the project I tested with and it works https://cloud.jeremydev.ovh/index.php/s/6JQQR4AZDwRQkrP
in rfmp.php

$upload_dir = 'storage/uploads/files/';
$thumbs_upload_dir = 'storage/thumbs/';
$current_path = 'storage/uploads/files/';
$thumbs_base_path = 'storage/thumbs/';

Capture d’écran de 2020-04-20 16-58-02

@raymondugv
Copy link
Author

Hi @Kwaadpepper ,

Here's what I've get when the browser returned

image

Since I'm now using symlink for the storage folder inside public directory, any chance that it caused this issue?

image

@Kwaadpepper
Copy link
Owner

Kwaadpepper commented Apr 21, 2020

have you created an uploads folder inside storage ?
you have to create it, only the thumbs folder will be created automatically. This is the default behavior. It is written in the README.md

@raymondugv
Copy link
Author

Hi @Kwaadpepper ,

I've already created the folder.

image

@Kwaadpepper
Copy link
Owner

Kwaadpepper commented Apr 21, 2020

Well maybe the sim link is causing this. You should try to create a real folder first.
public/storage/uploads Then test uploads.
If it works, It should, then the issue is with your server configuration. I guess. Check the folder permissions of ```storage``.

Also, Laravel provides a way to do the link https://laravel.com/docs/7.x/filesystem#the-public-disk


I can confirm that i have done what you wanted :

rfm.php

$upload_dir = 'storage/uploads/files/';
$thumbs_upload_dir = 'storage/thumbs/';
$current_path = 'storage/uploads/files/';
$thumbs_base_path = 'storage/thumbs/';

then simlink

php artisan storage:link

Capture d’écran de 2020-04-21 12-00-02

Capture d’écran de 2020-04-21 12-00-20

@raymondugv
Copy link
Author

So far I've already tried.

  • Removed the symlink and then created new folder, but it just created the new thumbs folder inside, but can't upload any file.
  • Since I running Laravel 6 on Windows using Valet. So couldn't using the ls -la public command like you shown me above.

I don't know what to do :(.

@Kwaadpepper
Copy link
Owner

Kwaadpepper commented Apr 21, 2020

the ls command is like the dir command in windows, it just show folder content.

Remember in storage, there must be a folder uploads, and in uploads you must have a files folder. => storage/uploads/files
Is it the case ?

image

@raymondugv
Copy link
Author

Hi,

It is.

image

The same like you, but I don't know why it didn't work...

@Kwaadpepper
Copy link
Owner

I have uploaded my working folder I have showed you. Also take a look at logs files, from your webserver, Valet ? and from storage/logs
responsiveFilemanagerGithub.7z

@Kwaadpepper
Copy link
Owner

Kwaadpepper commented Apr 23, 2020

I think there is an issue with valet laravel/valet#787
If i were you I would use wsl to install a apache server on a linux distribution.
If you prefer an easier way you could try https://sourceforge.net/projects/wampserver/
Maybe an easier way is https://www.phpcaddy.co/

@raymondugv
Copy link
Author

I think there is an issue with valet laravel/valet#787
If i were you I would use wsl to install a apache server on a linux distribution.
If you prefer an easier way you could try https://sourceforge.net/projects/wampserver/
Maybe an easier way is https://www.phpcaddy.co/

I see,

Thank you for helping me.
I'll try using other localhost method. 👯

@weeradach
Copy link

same issue, T.T, Please tell me if there is a solution.

@weeradach
Copy link

No matter you specific upload_dir wherever, system is upload in root directory.

@quangthienit1994
Copy link

Same Issue, tried other folder, but still error @Kwaadpepper, Sure folder exists and correct path. tried manual put image to folder public and see that image in dialog.php. But can't upload. example:
fopen(uploads/test.jpg): Failed to open stream: No such file or directory

@quangthienit1994
Copy link

image

@quangthienit1994
Copy link

image

@Kwaadpepper
Copy link
Owner

Please be advised that this repo is not maintenaned any more nor the file manager it is based on. You should try https://unisharp.github.io/laravel-filemanager/

I don't have time to maintain this.
Sorry I will archive this repo

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid This doesn't seem right question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants