-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot upload photo #47
Comments
Are you Wamp or Lamp based? If you are Lamp based hosting, you need to remove the firewall for post to work. please setenforce 0 |
I use EasyPHP for simple. http://www.easyphp.org/ |
At least thumbnail generation isn't checking if thumbnail folder exist. Try adding to beginning of app\helpers\thumbnail.php this: $thumbnail_directory = dirname($thumbnail_image_path); |
I may have the same issue. Did some debugging and noticed that Input::hasFile('picture') is always null in the controller. |
I have been looking at this issue for some time now. I figured out the issue is that pictures can't be serialized when the ajax call is being made. I am personally trying to work on a fix now and I have had success with it. The only problem is now with the folder being named www instead of public, it will take me much more time to fix because that is where ultimately the pictures should be stored, I don't really want to think about converting it right now. |
I hope somebody can implement third party image management like intervention at http://image.intervention.io/ This plugin is quiet easy to use. I couldn't figure it out in this starter app because of image naming convention is hashed with sha1. I was successful in implementing in my earlier app using laravel 4.2 and still trying for this laravel 5 |
@douxlagithub https://github.com/Intervention/image (it has support for laravel 5) |
@nextpulse I am not sure what you mean by your statement to me. if you look at form.serialize(), files cannot be serialized, http://api.jquery.com/serialize/. That is why if you do Log::info(Input::all()), first import or "use Log;", you will see it missing the picture field in the log. The quick way I got around this was to simply avoid using the ajax call with the form. Rather I just closed the box and sent the form without preventing the default event. This is the quickest way of doing based on the way the code is written. However the draw back is no feedback on invalid saves. I had to also create the image directory as well. |
@applecrusher I didn't realize the code was doing an ajax form request!! Now I see the issue. Found a few typos and js/css not found issue in the same file (modal.blade.php). May have to rework it to bypass the serialization for file upload. Anyhow, thanks for the info - now at least I know where to look. |
So I did a quick 'hack' to make this work. For file upload forms, I added the id 'fupload' and amended modal blade. (Its ugly, but fixes it so I can at least proceed). if (form.attr('id') == '' || form.attr('id') != 'fupload'){ |
BTW: the code in the PhotoController for saving the photo album/photos is not recommended. The reason is that it does not leverage the laravel 5 file system. (Meaning it does not take advantage of changes to the default storage - local, s3 etc) http://mattstauffer.co/blog/laravel-5.0-cloud-file-drivers IMHO: Probably best to take sometime to rewrite the file upload/save code - that that we understand it a bit better. (I'll add to this thread based on any new rewrites that I do). |
To avoid hard coded paths (public_path() etc) in PhotoController, I took a deeper look at the Laravel 5 file system. http://laravel.com/docs/5.0/filesystem The best approach seems to be: https://github.com/GrahamCampbell/Laravel-Flysystem This means you don't have to hard code paths in PhotoController and have everything configurable via a config file. (Switch from local disk store to s3 etc). |
THX for advice and show me a bugs, but main problem is me not having enough free time to work on the project, I will tray to find some free time to do it well. Sorry for waiting some new fixes :( |
This is the fix for this issue. It requires changing 1 line and adding three more variables. This also allows optional feedback. In resources/views/admin/layouts/modal.blade.php change the ajax to the following:
Let me know how this works for everyone. |
Again, after tried out some tricks, I was unable to upload photo whether in an article and in photo album. Help please! I am so excited to develop this starter app, and I am still learning many things about laravel.
The text was updated successfully, but these errors were encountered: