I'm using jquery file upload and want to apply it to my site. So, I unzipped archive and uploaded it's content on server (I'm using php). I can see demo page there, also I've chmoded directory /server/php/files to 777. Files are succesfully uploaded to directory. Also I can see thumbnails of uploaded pictures, when I add them: . But when I use start upload button it uploads file but stops displaying thumbnails and gives me folowing mistake. Has anyone met that mistake? Any suggestions? UPDATE: Here is initialization:
$('#fileupload').fileupload({
// Unment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: 'server/php/UploadHandler.php',
disableImageResize : false,
process: [
{
action: 'load',
fileTypes: /^image\/(gif|jpeg|png)$/,
maxFileSize: 20000000 // 20MB
},
{
action: 'resize',
maxWidth: 1920,
maxHeight: 1200,
minWidth: 20,
minHeight: 10
},
{
action: 'save'
}
],
});
UPDATE1: I've added attribute data-url to the same uploader to form and to it's action. Now I get mistake: SyntaxError: Unexpected end of input
I'm using jquery file upload and want to apply it to my site. So, I unzipped archive and uploaded it's content on server (I'm using php). I can see demo page there, also I've chmoded directory /server/php/files to 777. Files are succesfully uploaded to directory. Also I can see thumbnails of uploaded pictures, when I add them: . But when I use start upload button it uploads file but stops displaying thumbnails and gives me folowing mistake. Has anyone met that mistake? Any suggestions? UPDATE: Here is initialization:
$('#fileupload').fileupload({
// Unment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: 'server/php/UploadHandler.php',
disableImageResize : false,
process: [
{
action: 'load',
fileTypes: /^image\/(gif|jpeg|png)$/,
maxFileSize: 20000000 // 20MB
},
{
action: 'resize',
maxWidth: 1920,
maxHeight: 1200,
minWidth: 20,
minHeight: 10
},
{
action: 'save'
}
],
});
UPDATE1: I've added attribute data-url to the same uploader to form and to it's action. Now I get mistake: SyntaxError: Unexpected end of input
Share Improve this question edited Jan 23, 2015 at 8:02 Sergey Scopin asked Jan 23, 2015 at 4:30 Sergey ScopinSergey Scopin 2,24510 gold badges40 silver badges70 bronze badges 6- have you got any console errors whn u click the start btn..?? – Nibin Commented Jan 23, 2015 at 4:33
- Nope, console is empty. – Sergey Scopin Commented Jan 23, 2015 at 4:35
-
Have you tried setting
disableImageResize
to false – Nibin Commented Jan 23, 2015 at 5:06 - Also, I have another issue with using it at site(not in demo category). I'll create a question and post link here. – Sergey Scopin Commented Jan 23, 2015 at 6:22
- could you try reducing the parameters like Width and Height – Nibin Commented Jan 23, 2015 at 6:22
5 Answers
Reset to default 3@Snoozer right, I also had the same issue, I am using php v7 and after enable the gd
extension its fixed.
you should open your php.ini file and unment this line:
extension=php_gd2.dll
Update for the ment that I've read in the options array:
// Set to 0 to use the GD library to scale and orient images,
// set to 1 to use imagick (if installed, falls back to GD),
// set to 2 to use the ImageMagick convert binary directly:
'image_library' => 1,
I had the same problem, but it was the gd extension or imagick extension was not installed in my php server.
Got same problem on one of Heroku servers and just fixed this by adding
"ext-gd": "*",
to poser.json file require section, hope this will help some one in the future.
sudo apt-get install php7.0-gd
or
sudo apt-get install php7.1-gd
or
sudo apt-get install php7.2-gd Can solove the question
Give 777 permissions to folder to which ur uploading files. sudo chmod 777 -R folderpath it solved for me
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745123868a4612576.html
评论列表(0条)