jQuery uploader error help

Here is the error:
DSC05812.JPG 143.38 KB Error: SyntaxError: JSON.parse: unexpected character

I am using the RC3 for 1.4.2

PHP 5.2.17
Mysql 5.0.77

This happens with the jquery uploader only
the flash and http work fine

Not sure if this is functioning yet or not or if there is a fix, but thought I would check since this is my preferred method of uploading.

Thanks

Comments

  • Probably going to need more details since I am unable to reprocduce the error. Not sure what, though, so as much information as possible.
  • Ok, here's what I can give you

    Hosted at godaddy
    Fresh install of 1.4.2
    PHP and MySQL listed above

    Uploading the file using the jQuery uploaded (drag and drop or clicking)

    I'm trying to upload from a Mac using ltest Firefox

    Anything else you need to know to help point in the right direction
    I'm going to try the upload on a PC and in different browsers to see if that could be it
  • My tests were on PCs, so I await your next post. The JSON processing does happen on the client, so it could be specific to the MAC.
  • OK, two things.

    First, on the PC, it I get the confirmation that the file was uploaded (the green acknowledgment) but the file does not appear.

    I then used firebug on the mac and got the following Warning:

    move_uploaded_file(/public_html/zp-core/admin-jQuery/files/Danger.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in <b>/public_html/zp-core/admin-jQuery/uploader.php</b> on line <b>313</b>
    <b>Warning</b>: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpF87uuh' to '/public_html/zp-core/admin-jQuery/files/Danger.jpg' in <b>/public_html/zp-core/admin-jQuery/uploader.php</b> on line <b>313</b>

    <b>Fatal error</b>: Call to a member function setOwner() on a non-object in <b>/public_html/zp-core/admin-jQuery/uploader.php</b> on line <b>317</b>

    Danger.jpg is the name of my test file.
    Now I noticed it's looking for a "files" folder in the admin-jQuery folder. This doesn't exist so I would guess I also have a path issue possibly.
    Does that need to be set somewhere since it's not getting my albums folder??
  • I looked at line 78 and 79 of uploader.php. Maybe that has something to do with the problem.

    'upload_dir' => dirname(__FILE__).'/files/',
    'upload_url' => dirname($_SERVER['PHP_SELF']).'/files/',

    since that folder doesn't exist anyway
  • What are your file permissions for the admin-jquery folder?
  • Never mind. Lines 78 and 79 are a red herring. The actual folders are set by the class instantiation to point to the album folder where the image is to go.
  • This must be a server thing
    I updated my PC firefox to the latest and it produces the same error

    Also if using Safari on Mac, the error is slightly different in that it says something along the lines of
    Error invalid identifier '<'

    Next I'll try changing all permissions on the folders to see if that makes a difference
  • Well, permissions didn't change anything but I tested locally and on a completely separate server and I get the error on all three.

    Then I tried using PHP 5.2.13 on local server - error appeared.
    Then upgraded to 5.3.2 and no more error.

    Just for fun I tested the old uploader in 1.4.1.6 and it works fine with drag and drop files.

    So it looks to me (at first glance) that PHP 5.3 may be the minimum requirement to use the jQuery uploader. Anything less seems to cause the error.

    Does that sound about right?
  • Maybe I spoke too soon.
    Test locally it's fine. Updated my server to 5.3.6 but the error still occurs

    Although with firebug, the only warning is:

    Fatal error: Call to a member function setOwner() on a non-object in /public_html/zp-core/admin-jQuery/uploader.php on line 273

    Although now the files actually get uploaded correctly.
    Just no confirmation of successful upload.
  • Your error above indicates that there is still something failing in the upload. There should be something in the debug log tracking this--a bad album or image instantiation.

    As to the PHP level, it could be a PHP level issue. There is no documentation of any level requirement with the jquery uploader source, though. Still, it could well be a bug in PHP 5.2.13.
  • I reset the debug log, ran a test, got the error but nothing shows in the debug.
    I'm at a loss.
  • The only thing I can see is that the line numbers for these errors seem to be off from the current nightly build. I did not think there have been changes to the uploader.php file since RC3, but maybe try the nightly build and see what happens.

    If you do still get the errors, report back again exactly the errors that show up against the nightly build.

    Any chance that the image already exists on disk? If so what are its file permissions?
  • Perhaps this can be of help, since I get the same error, but only when uploading an image that already exists in the database, at least with the same filename. When I delete the existing image and try again, the jquery upload works fine.
  • I'm having the same problem also. Have tried a reinstall and even set up a new database etc. No joy. It works OK for the first say 10 photos uploaded to the gallery, but any more and it's a no go. I get the same/similar errors with both http and jquery.

  • acrylian Administrator, Developer

    Any special chars in the failing images' filename in question maybe?

Sign In or Register to comment.