Demo Installed - Works for files under 1MB, has error message for files 1MB+

1,561 views
Skip to first unread message

JT_Dylan

unread,
Jan 30, 2013, 12:21:23 PM1/30/13
to jquery-f...@googlegroups.com
Hi,
   I want to edit the demo to allow large file uploads specifically for video uploads to S3.  I've installed the demo, changed folder permissions (777 - ugh), and have been able to upload images <1MB without error.  I tried images <2MB, the file uploads, but I receive the following error SyntaxError: JSON.parse: unexpected character.  I tried to modify the js/main.js file to change the upload settings (demo is set to 5MB or less) here are the edits I made (I'll leave out the whole file).

...
    if (window.location.hostname === 'blueimp.github.com') {
        // Demo settings:
        $('#fileupload').fileupload('option', {
            url: '//jquery-file-upload.appspot.com/',
            //maxFileSize: 5000000,
            //acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
            maxFileSize: 5000000000,
            acceptFileTypes: /(\.|\/)(gif|jpe?g|png|mp4|mov)$/i,
            process: [
                {
                    action: 'load',
                    //fileTypes: /^image\/(gif|jpeg|png)$/,
                    //maxFileSize: 20000000 // 20MB
                    fileTypes: /^image\/(gif|jpeg|png|mp4|mov)$/,
                    maxFileSize: 5000000000 // 5000MB
                },
                {
                    action: 'resize',
                    maxWidth: 1440,
                    maxHeight: 900
                },
                {
                    action: 'save'
                }
            ]
        });
....

I then tried to upload a 60MB video (max file size set to 5,000,000,000 = 5GB above) but I still get the same issues, files under 1MB upload, 1.5MB uploads but with JSON.parse error message, and 60MB does not upload and has JSON.parse error message.

Any assistance is greatly appreciated.

Regards,
John

JT_Dylan

unread,
Jan 30, 2013, 1:02:41 PM1/30/13
to jquery-f...@googlegroups.com

Update:
Ok, I made the following changes in my PHP.ini

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).

upload_tmp_dir = /Applications/MAMP/tmp/php

; Maximum allowed size for uploaded files.
upload_max_filesize = 0

max_execution_time = 60  ; Maximum execution time of each script, in seconds
max_input_time = 180     ; Maximum amount of time each script may spend parsing request data
memory_limit = 100M      ; Maximum amount of memory a script may consume (8MB)

And now I can upload  files up to 33MB in size but no greater.  Any ideas on next steps?  I thought this code would relieve any need to make server side setting changes?

-J

JT_Dylan

unread,
Jan 30, 2013, 5:10:35 PM1/30/13
to jquery-f...@googlegroups.com


On Wednesday, January 30, 2013 12:21:23 PM UTC-5, JT_Dylan wrote:

Update:

I changed the following in php.ini:

; Maximum size of POST data that PHP will accept.
post_max_size = 500M

Now I can upload upwards of 250MB.  Largest video I have on my machine so I'll need to test with a larger file later. 

End changes to php.ini:


; Whether to allow HTTP file uploads.
file_uploads = On

; Maximum size of POST data that PHP will accept.
post_max_size = 500M


; Temporary directory for HTTP uploaded files (will use system default if not
; specified).

upload_tmp_dir = /Applications/MAMP/tmp/php

; Maximum allowed size for uploaded files.
upload_max_filesize = 0

max_execution_time = 60  ; Maximum execution time of each script, in seconds
max_input_time = 180     ; Maximum amount of time each script may spend parsing request data
memory_limit = 100M      ; Maximum amount of memory a script may consume (8MB)


Question: What effect do these changes have for the server?  I'm guessing these maybe detrimental.  Any advice on how to avoid having to make these settings changes?  I'm planning to use AWS elastic beanstalk.

-J

billy rennekamp

unread,
Feb 3, 2013, 8:17:20 PM2/3/13
to jquery-f...@googlegroups.com
hey i'm having the same problem with the demo
i've also increased all of my php limits and the file uploads but i still get 
SyntaxError: Unexpected end of input
the files upload fine but the error shows up. 
smaller files work fine with no syntax error.

also question why do you have your upload_max_filesize set to 0?
is that on purpose?


 

On Wednesday, January 30, 2013 12:21:23 PM UTC-5, JT_Dylan wrote:

Emily Castles

unread,
May 22, 2013, 7:53:04 AM5/22/13
to jquery-f...@googlegroups.com
Hey billy - Did you ever get your problem sorted out? I'm having the same issue - the file's upload but I'm getting SyntaxError: Unexpected end of input error" every time

billy rennekamp

unread,
May 22, 2013, 8:03:50 AM5/22/13
to jquery-f...@googlegroups.com
It ended up being a max file limit issue.
i had the values changed in my php.ini but there was an .htaccess file overriding those values
whoops : \
try checking your developer panel in your browser and see exactly what the response your'ge getting is under network.
(command+option+j for chrome on a mac)
good luck



--
You received this message because you are subscribed to a topic in the Google Groups "jQuery-File-Upload" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jquery-fileupload/zKgKBHnYbq0/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to jquery-fileupl...@googlegroups.com.

To post to this group, send email to jquery-f...@googlegroups.com.
Visit this group at http://groups.google.com/group/jquery-fileupload?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
billyrennekamp.com

Laurie Tsakiris

unread,
Oct 9, 2013, 6:03:05 PM10/9/13
to jquery-f...@googlegroups.com
I'm having the same issue. Has anyone figured this out yet?

billy rennekamp

unread,
Oct 9, 2013, 9:44:39 PM10/9/13
to jquery-f...@googlegroups.com
hey laurie,
did you check phpinfo() and your .htaccess file?

Laurie Tsakiris

unread,
Oct 10, 2013, 12:48:37 AM10/10/13
to jquery-f...@googlegroups.com
hey billy thanks for replying.

im not running this in a php app Im running it in a cfml app. I will check the server vars for file size, etc though as mentioned previously


--
You received this message because you are subscribed to a topic in the Google Groups "jQuery-File-Upload" group.

To unsubscribe from this group and all its topics, send an email to jquery-fileupl...@googlegroups.com.
To post to this group, send email to jquery-f...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages