Jump to content

image upload gettings stuck on 100%


onjegolders

Recommended Posts

Hi guys, I've seen this has been an issue for others but it involved PHP safe_mode being on which isn't the case here.

I've just transferred a site from dev to live using the site export module and when I go to upload a new image, the bar goes all the way to 100% and then the image doesn't show.

Could anyone point me in the right direction? Am pretty sure assets is writable...

  • Like 1
Link to comment
Share on other sites

What does JS console say? PW error logs? Apache error logs?

Hi Apeisa, I'm getting the following JS errors:

Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://mysite.com/processwire/page/edit/?id=1

Uncaught TypeError: Cannot read property 'error' of null http://mysite.com/wire/modules/Inputfield/InputfieldFile/InputfieldFile.js

and lots of:

Failed to load resource: the server responded with a status of 404 (Page Not Found) with links to the image file and timestamp on the end

Am thinking something must have gone wrong with the file transfer?

Link to comment
Share on other sites

Check the GD library, You can do it quickly like this:

<?php
if (extension_loaded('gd') && function_exists('gd_info')) {
echo "hm no, GD is not the problem...";
}else{
echo "ah! I think we found it ";
}
  • Like 1
Link to comment
Share on other sites

Had this issue just recently. This is something weird, I think Mac permission related (copied the files from an USB stick which was written by WIN). Some images work, some others don't. First I thought it has something to do with the size of the images, but that was not the case. What I did (also sounds weird): I used "Automator", a very useful app, to resize the images to a reasonable size (even if not needed). So just create a new workflow with 1. "Get specified Finder items" and 2. "Scale images". Drag your files into the upper window and enter the size in the second window to 1600 or whatever. The images get rescaled and rewritten. After that the permissions / files seem to be okay for drag&drop.

Link to comment
Share on other sites

Thanks Made and Andrew, so you think it's a file size issue? Don't think the images were even that big, it feels more like that somewhere in the process of exporting my profile, something went wrong - though I have no idea what as I followed all the steps?

Check the GD library, You can do it quickly like this:

<?php
if (extension_loaded('gd') && function_exists('gd_info')) {
echo "hm no, GD is not the problem...";
}else{
echo "ah! I think we found it ";
}

I've since deleted off the server and seeing as it takes about 367889999967 years for me to upload via FTP will try again later when I have another profile site to upload :) Will let you know, thanks!

Link to comment
Share on other sites

  • 2 weeks later...

Working on a Mac using Safari and Firefox, I recently had exactly the same problem after moving a website from developing server to live server (from another provider). After that I could only upload images with a file size of max. 200 KB, while max upload file size set by the provider was 16 MB.

In Internet Explorer 8 I had no problems uploading larger files. In that browser the AJAX-uploader (with drag-and-drop functionality) isn't supported, instead the 'classic' uploader is used. So I thought the AJAX-uploader should be the problem. I solved the problem after editing line 296 of InputfieldFIle.js (wire/modules/Inputfield/InputfieldFile/) from:

InitHTML5(); 

into:

InitOldSchool();

Strange thing is that this problem only shows up at some providers...

  • Like 3
Link to comment
Share on other sites

I had the same issue when uploading images. Turned out that my storage space on the server was full. You probably already checked but wanted to mention it as a possible problem.

This also turned out to be a mod_security setting. Once changed everything started working as expected.

Link to comment
Share on other sites

  • 3 weeks later...

I had the same issue right now for the first time.

It's my own server, so there are no restrictions through a provider. I have already installed several PW sites on this server and never had that problem before.

The error console says:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)
JqueryCore.js:2SyntaxError: JSON Parse error: Unexpected identifier "Error"

I checked if maybe the storage space was full, but that was not the fact.

The main PHP version on the server is still 5.2.17 - i have decided to install PHP 5.3 additional because there are some websites running on my server who are not compatible to > PHP 5.2

On the webspace where i encountered that problem i had chosen PHP 5.3 through htaccess:

AddHandler application/x-httpd-php53 .php

When i remove that line so PHP 5.2.17 is used for this webspace again, everything works fine with the upload.

I am using the latest dev branch of PW.

So in this case it seems to be a PHP version problem - but of course it's strange that the problem appears under the additional installed 5.3, not under 5.2.17 

Link to comment
Share on other sites

Check your /site/assets/logs/errors.txt to see if you can get more details about the error that occurred. A PHP version change really shouldn't matter for this, but I'm wondering if the 5.3 and 5.2 are running from different php.ini files with different restrictions. 

Link to comment
Share on other sites

You most likely ran out of memory. MAMP and other *AMP installs often come configured with 32 MB memory limit for PHP, which isn't enough to upload largish files via ajax. View your phpinfo to see where your php.ini file is located. Edit it, and change memory_limit to 256M. Also in php.ini, update post_max_size to be the same or larger. Restart server and double check that the changes took effect by finding memory_limit in your phpinfo output. 

  • Like 4
Link to comment
Share on other sites

  • 2 weeks later...

I had this same problem uploading images on my localhost setup.

Increasing php.ini post_max_size and memory_limit to 256M did the trick, thanks!

Is there an upper limit for how high this can be increased? I plan to upload some large soundfiles in the future.

It's great to get back into ProcessWire after being busy with other things for a little while!

Link to comment
Share on other sites

Depends on the Hardware of your server. Most standard shared hosting don't allow setting to high values.

When uploading big files, you should also check out the settings "max_input_time" and "max_execution_time".

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

I've been having this problem again recently and I have no idea why but if I rename the file extensions from .jpg to .png they upload fine.

Strange.

Edit: Scratch that, they upload fine but then behave weirdly in the front end and don't seem to be cropped.

Link to comment
Share on other sites

  • 1 year later...

Sorry for bumping this old topic, but I still have this problem on my server. It happens to some images or files, regardless of the type, which exceed certain size (I think over 1MB, but not sure). I am not on Apache though, it is Nginx+PHP-FPM setup.

Anyone who was able to overcome such problems is welcome to suggest something. Thanks!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...