Advertisement:

Author Topic: Upload failure reason unknownX -> unable to upload images for the ads  (Read 11607 times)

legtech

  • Newbie
  • *
  • Posts: 19
Dear Forum Members,

I am running a website with OS Class 3.6.1 and Bender Black theme (3.1.3), today I tried to add some ads to the website and when I got to the part where I am supposed to upload pictures it gives an error "Upload failure reason UnknownX".

I have looked thru the previous posts on this problems, I would like to note that I have tried disabling and enabling Image Magick / GD - did not solve the issue.
I checked the permissions for the uploads folder - 755.

If someone could guide me on what to do next and where to look I would immensely appreciate it!

Thank you in advance for your time and attention! I truly appreciate all the support I get here.

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Upload failure reason unknownX -> unable to upload images for the ads
« Reply #1 on: April 11, 2016, 04:06:41 pm »
Hi,

That happened suddenly? Were you able to upload images before? If so, have you changed anything recently (some new plugin, theme modifications...)?

Ebable debug to see if there are PHP errors:

https://doc.osclass.org/Debug_PHP_errors

Regards

legtech

  • Newbie
  • *
  • Posts: 19
Re: Upload failure reason unknownX -> unable to upload images for the ads
« Reply #2 on: April 11, 2016, 04:55:03 pm »
The Debug Log shows the following:
-Quote-

Stack trace:
#0 /home/asb/KERWEN/kerwen.tk/oc-includes/osclass/classes/ImageResizer.php(24): ImageResizer->__construct('/home/legtech/K...')
#1 /home/asb/KERWEN/kerwen.tk/oc-includes/osclass/controller/ajax.php(297): ImageResizer::fromFile('/home/legtech/K...')
#2 /home/asb/KERWEN/kerwen.tk/index.php(117): CWebAjax->doModel()
#3 {main}
  thrown in /home/asb/KERWEN/kerwen.tk/oc-includes/osclass/classes/ImageResizer.php on line 41

-Unquote-

That line 41 (last string) looks like:

40        private function __construct($imagePath) {
41            if(!file_exists($imagePath)) { throw new Exception(sprintf(__("%s does not exist!"), $imagePath)); };
42            if(!is_readable($imagePath)) { throw new Exception(sprintf(__("%s is not readable!"), $imagePath)); };
43            if(filesize($imagePath)==0) { throw new Exception(sprintf(__("%s is corrupt or broken!"), $imagePath)); };

Previously (about a month ago) I uploaded two images as a test. And everything went fine. Then I had some modifications to the plugins - Cars Attributes, Payments Pro. Then I got low disk space issue and resolved it with my hosting provider (there is a forum topic here) having edited the php ini file.

The full Debug message is below:

[11-Apr-2016 17:50:30 Asia/Tashkent] PHP Fatal error:  Uncaught exception 'Exception' with message '/home/asb/KERWEN/kerwen.tk/oc-content/uploads/temp/qqfile_570b9d9640143.jpeg does not exist!' in /home/legtech/KERWEN/kerwen.tk/oc-includes/osclass/classes/ImageResizer.php:41
« Last Edit: April 11, 2016, 05:02:30 pm by legtech »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Upload failure reason unknownX -> unable to upload images for the ads
« Reply #3 on: April 11, 2016, 05:05:49 pm »
Check that /home/asb/KERWEN/kerwen.tk/oc-content/uploads/temp has 755 permissions ???

legtech

  • Newbie
  • *
  • Posts: 19
Re: Upload failure reason unknownX -> unable to upload images for the ads
« Reply #4 on: April 11, 2016, 05:13:44 pm »
Permissions for /oc-content/uploads/temp are set at 755


teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Upload failure reason unknownX -> unable to upload images for the ads
« Reply #5 on: April 11, 2016, 05:52:13 pm »
FTP to your site, go to /oc-content/uploads/temp, clean up everything there.

Now login as user on your site, publish an ad, just upload a JPG image. Refresh FTP view and see if there is now a qqfile_xxxxxxxxxxxxxx.jpg. If not so, set permissions to 777 and try again.

legtech

  • Newbie
  • *
  • Posts: 19
Re: Upload failure reason unknownX -> unable to upload images for the ads
« Reply #6 on: April 12, 2016, 08:05:40 am »
Dear teseo,

Did everything as you said:
Emptied uploads/temp folder (btw there was index.php file and 2 images). Permissions set at 755. Same error when uploading pictures on front end.
Changed permissions to 777 - same. In both cases the temp folder remained empty.


legtech

  • Newbie
  • *
  • Posts: 19
Re: Upload failure reason unknownX -> unable to upload images for the ads
« Reply #7 on: April 12, 2016, 08:21:32 am »
In addition to above, the error message changed from previous "Upload failure reason unknown" to "XHR returned response code 500".

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Upload failure reason unknownX -> unable to upload images for the ads
« Reply #8 on: April 12, 2016, 12:53:50 pm »
Try my plugin Pre-resize Images, it has been reported it has solved those XHR errors ???

http://market.osclass.org/plugins/miscellaneous/pre-resize-images_496

Regards


legtech

  • Newbie
  • *
  • Posts: 19
Re: Upload failure reason unknownX -> unable to upload images for the ads
« Reply #9 on: April 12, 2016, 01:11:57 pm »
Dear teseo,

I have installed the pre-resize plugin, modified the line in item-post.php (as shown in instructions to the plugin). But the uploading is still not possible. However, now the error shown on front end says that "File is empty". Also, the progress bar (when uploading the image seems to be moving, I mean kilobytes are increasing as if the image is uploading, but at the end it shows an error message.

According to debug log the problem is still with line 41 in ImageResizer.php
uploads/temp is still empty (after I've deleted everything thru FTP)
« Last Edit: April 12, 2016, 01:14:39 pm by legtech »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Upload failure reason unknownX -> unable to upload images for the ads
« Reply #10 on: April 12, 2016, 01:52:08 pm »
Sorry I don't know what's happening to you. ??? I can see that you're running PHP 5.6, do you have a way to downgrade to PHP 5.4 provisionally so we might discard that's the issue?

Regards

legtech

  • Newbie
  • *
  • Posts: 19
Re: Upload failure reason unknownX -> unable to upload images for the ads
« Reply #11 on: April 12, 2016, 02:29:33 pm »
Dear teseo,

I figured out the problem.  :D :D :D

In your first reply you were asking if there were any previous issues with the site, and I told about low disk space I got resolved thru php.ini.
Back then my hosting provider edited my php.ini to switch to PHP 5.6 from 5.4 (payments pro plugin works with at least 5.6). So back then the support team edited the memory_limit as 512M, whereat the file itself interpreted it as 512 bytes and not megabytes. I had figured out the problem myself (with help of GitHub) and edited that line in bytes.

Now, I accidentally checked that file again, and saw that the max_upload_limit was also set to 512M, i.e., same as before, it was interpreted as 512 bytes! So, I just entered the value in bytes.

As of now the images are being uploaded smoothly. I can't believe the solution was so simple, and I could not figure it out.

Anyway, immense thanks for your invaluable time, efforts and support, teseo!  :D

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Upload failure reason unknownX -> unable to upload images for the ads
« Reply #12 on: April 12, 2016, 02:55:17 pm »
I can't believe the solution was so simple, and I could not figure it out.

E=mc2. Everything seems simple when you know the answer. :D

Glad you solved your issue, regards