Giter Club home page Giter Club logo

Comments (14)

cklam avatar cklam commented on August 12, 2024

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

from laravel-5-bootstrap-3-starter-site.

douxlagithub avatar douxlagithub commented on August 12, 2024

I use EasyPHP for simple. http://www.easyphp.org/
How about using Intervention Image at http://image.intervention.io/ this plugin seems quiet pretty and very simple to use.

from laravel-5-bootstrap-3-starter-site.

zei avatar zei commented on August 12, 2024

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);
if(!file_exists($thumbnail_directory)) {
mkdir($thumbnail_directory);
}

from laravel-5-bootstrap-3-starter-site.

nextpulse avatar nextpulse commented on August 12, 2024

I may have the same issue.

Did some debugging and noticed that Input::hasFile('picture') is always null in the controller.

from laravel-5-bootstrap-3-starter-site.

applecrusher avatar applecrusher commented on August 12, 2024

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.

from laravel-5-bootstrap-3-starter-site.

douxlagithub avatar douxlagithub commented on August 12, 2024

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

from laravel-5-bootstrap-3-starter-site.

nextpulse avatar nextpulse commented on August 12, 2024

@douxlagithub https://github.com/Intervention/image (it has support for laravel 5)
@applecrusher you may be right - but it should a form POST request in the code.
@mrakodol - what platform are you developing on? I am asking, as I am seeing a lot of platform dependent EOL in the source files. May also explain why it may work on one platform vs another (just speculating)

from laravel-5-bootstrap-3-starter-site.

applecrusher avatar applecrusher commented on August 12, 2024

@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.

from laravel-5-bootstrap-3-starter-site.

nextpulse avatar nextpulse commented on August 12, 2024

@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.

from laravel-5-bootstrap-3-starter-site.

nextpulse avatar nextpulse commented on August 12, 2024

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'){
$.ajax({
type : form.attr('method'),
url : form.attr('action'),
data : form.serialize()
}).complete(function() {
setTimeout(function() {
parent.$.colorbox.close();
window.parent.location.reload();
}, 10);
}).fail(function() {});
}else{
var formData = new FormData(this);
$.ajax({
type : form.attr('method'),
url : form.attr('action'),
data : formData,
mimeType:"multipart/form-data",
contentType: false,
cache: false,
processData:false
}).complete(function() {
setTimeout(function() {
parent.$.colorbox.close();
window.parent.location.reload();
}, 10);
}).fail(function() {});
};

from laravel-5-bootstrap-3-starter-site.

nextpulse avatar nextpulse commented on August 12, 2024

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).

from laravel-5-bootstrap-3-starter-site.

nextpulse avatar nextpulse commented on August 12, 2024

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).

from laravel-5-bootstrap-3-starter-site.

stojankukrika avatar stojankukrika commented on August 12, 2024

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.
Until that, I hope that you understand me, and if someone have some free time to help, can make some poll request and I will approve it.

Sorry for waiting some new fixes :(

from laravel-5-bootstrap-3-starter-site.

applecrusher avatar applecrusher commented on August 12, 2024

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:

            $.ajax({
                type : form.attr('method'),
                url : form.attr('action'),
                data : new FormData(this),
                contentType: false,       
                    cache: false,             
                    processData:false
                }).complete(function() {
                    // Optionally alert the user of success here...
                    setTimeout(function() 
                        {
                            parent.$.colorbox.close();
                            window.parent.location.reload();
                        }, 10);

                }).fail(function(jqXHR, textStatus, errorThrown) {
                                    ....... add error status right here

Let me know how this works for everyone.

from laravel-5-bootstrap-3-starter-site.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.