Jump to content

Huge file uploading problem


Nico Knoll
 Share

Recommended Posts

Hey,

I'm trying to upload a couple of files between 5 and 30mb and I always ending up getting this errors in the console and the loading bars just stop moving:

post-140-0-35451200-1411935966_thumb.png

I tried it on two different sites on different servers running PW (2.3.1 and 2.4.0). I even tried Firefox and Chrome with both sites. Not sure if it fixed in PW 2.5 already...

Edit: Same problem with 2.5

Link to comment
Share on other sites

Nico, this is not a PW related thing. It is related to your server I think:  Server responded with a status of 503 (Service Unavailable)

What does it say in the phpinfo for:

  •     post_max_size
  •     upload_max_filesize

You may try to bump that up in the htaccess:

<IfModule mod_php5.c>
    php_value post_max_size 240M
    php_value upload_max_filesize 200M
</IfModule>

Maybe also you can check what is set as the temp upload dir in phpinfo, and if that exists and is writeable by PHP.

And, does it work with small files, < 1MB ?

Edited by horst
added one more thought :)
Link to comment
Share on other sites

It works perfectly with files up to 1.5mb. Maxfile size is by 40mb at the moment. I'll try your code. Thanks so far!

(I'm going to install ProcessDiagnostics to check that :) )

Edit: Can't find it in ProcessDiagnostics. Would be a good thing to add I think.

  • Like 1
Link to comment
Share on other sites

Is it possible to add those files into the right folder via ftp and somehow let PW import them?

I wouldn't use the site/assets/files/id/ folder, you should create / use a temp folder besides site and wire:

|-site

|-temp

|-wire

and then I would try to add them via API: $targetpage->filefield->add('/fullpath/to/temp/basename.ext');  // or is it called ->addfile()?

PS: if you would use a site/assets/files/id/ folder, it would create a basename-1.ext file I believe. (but not sure)

Edited by horst
  • Like 1
Link to comment
Share on other sites

Nico, is the upload taking longer than the max runtime of PHP scripts?

I think this isn't relevant for uploads, but also remember that there is something called like max-input-time in the php.ini?

EDIT: no, this (max_input_time) is also not relevant:

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

file_uploads = On
post_max_size = 240M
upload_max_filesize = 200M
upload_tmp_dir = 
Edited by horst
  • Like 1
Link to comment
Share on other sites

@horst, don't know if it does or not. Here's another possible starting point though: set_time_limit()

Update1: Looks like you might be right according to this on Stack Overflow. @nico, there are some apache config options to check in there too.

Update2: Added the timeouts to DiagnosePhp.module as well.

Edited by netcarver
  • Like 3
Link to comment
Share on other sites

 Update2: Added the timeouts to DiagnosePhp.module as well.

@netcarver: good! Can you also please do a check if it is possible to increase / decrease the max_execution_time with set_time_limit() or ini_set('max_execution_time') and reflect that in the output? Normally it should work but some (cheap shared) servers may have it disabled.

Link to comment
Share on other sites

I have uploaded a file of 42MB to my site via the PW admin to a file field. It tooks 8 minutes for successfull upload.

My settings from php.ini on this site are:

file_uploads	          On
max_file_uploads          20       // this I have found too, sounds like max number for simultaneous uploads
upload_max_filesize       200M
upload_tmp_dir	
post_max_size             240M

max_input_time            60       // has nothing to do with time used for fileupload!!

memory_limit              256M

enable_post_data_reading  On       // this I have found too, don't know what it mean

max_input_time is set to 60 seconds, so this is not relevant for fileuploads I think.

------

PS: @KentBrockman: thanks for the continued support. :)

  • Like 1
Link to comment
Share on other sites

@netcarver: good! Can you also please do a check if it is possible to increase / decrease the max_execution_time with set_time_limit() or ini_set('max_execution_time') and reflect that in the output? Normally it should work but some (cheap shared) servers may have it disabled.

@horst: Done for set_time_limit(). DiagnosePhp.module now at v0.0.4

  • Like 2
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...