This topic is locked

File Upload Help

3/9/2006 6:52:35 PM
PHPRunner General questions
T
Tommy B author

I've created a project that allows users to upload files to our secure website. However, when uploading files larger than a couple of megs, the upload seems to time out.
Are the max file upload sizes set somewhere? If so, how could I increase this?
Is there a timeout threshhold somewhere?
Any hints on how to better streamline this process would be helpful. Thanks.

S
sloftus 3/12/2006

Try this link. I had the same problem. You can edit the custom template in PHPRunner or you can change php.ini.
You may also be interested to read this link also. I had problem uploading files above the 2 Mb limit.
Hope this helps to solve your problem.

T
Tommy B author 3/13/2006

Try this link. I had the same problem. You can edit the custom template in PHPRunner or you can change php.ini.

You may also be interested to read this link also. I had problem uploading files above the 2 Mb limit.
Hope this helps to solve your problem.


Thanks!
Altering php.ini and implementing the template changes from both links did the trick for me. I appreciate your help.

T
Tommy B author 3/22/2006

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=8700&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' />--><div class='quotetop'>QUOTE(Tommy B @ Mar 13 2006, 11:24 AM) <{POST_SNAPBACK}></div><div class='quotemain'><!--quotec-->



Try this link. I had the same problem. You can edit the custom template in PHPRunner or you can change php.ini.
You may also be interested to read this link also. I had problem uploading files above the 2 Mb limit.
Hope this helps to solve your problem.


Thanks!
Altering php.ini and implementing the template changes from both links did the trick for me. I appreciate your help.

[/quote]
Things are working great with this application however, I've run into a minor problem. Once a file is uploaded it's got a permission of 600, which means I can't access/alter the files without doing so through the actual application (my process is to download the uploads via ftp).
Any idea how I can set the properties for a file as it is uploaded? I tried altering the permissions from ftp and a web-based file manager, and permission was denied. All I could do was download from the app or delete via ftp.

Sergey Kornilov admin 3/23/2006

Tommy,
you can modify ..._add.php and ..._edit.php files to change the uploaded files permission mode.

Replace this snippet:

foreach ($files_move as $file)

move_uploaded_file($file[0],$file[1]);

with the following:

foreach ($files_move as $file)

{

move_uploaded_file($file[0],$file[1]);

chmod($file[1],0777);

}

T
Tommy B author 3/23/2006

Tommy,

you can modify ..._add.php and ..._edit.php files to change the uploaded files permission mode.

Replace this snippet:

with the following:


This solutions works great. Thank you!

T
Tommy B author 3/24/2006

I've run into another hitch with this function.
I've added 19 additional file upload fields (giving our users the option to upload up to 20 files in one batch upload).
Now the chmod function no longer works if the user wants to upload less than 20 files. The following PHP Error is generated:

PHP error happened

Technical information

Error type 2

Error description chmod(): Operation not permitted

URL subdomain.domain.com/project/Upload_add.php?

Error file /home/xxxx/domains/domain.com/private_html/secure/project/Upload_add.php

Error line 235

SQL query insert into `Upload` (`description`, `File`, `File2`, `File3`, `File4`, `File5`, `File6`, `File7`, `File8`, `File9`, `File10`, `File11`, `File12`, `File13`, `File14`, `File15`, `File16`, `File17`, `File18`, `File19`, `File20`, `userid`) values ('EOBs / R&S', 'posttitle-20060324-103713.gif', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'tbbrents')

T
Tommy B author 3/27/2006

I removed the CHMOD code and restored the original code. This stopped the php error from ocurring but files are once again being uploaded with very limited permissions.
Any idea how to make the CHMOD code work for all of the file upload fields?

Sergey Kornilov admin 3/28/2006

Tommy,
try this code:

foreach ($files_move as $file)

{

if(move_uploaded_file($file[0],$file[1]))

chmod($file[1],0777);

}

T
Tommy B author 3/28/2006

This seems to work perfect. However, in Internet Explorer the browser returns a DNS error when trying to process the add/edit pages. It doesn't even try to upload. Just immediately delivers the "Cannot Find Server" error once I hit Save.
Seems to be working fine in Firefox thogh.

Sergey Kornilov admin 3/28/2006

Tommy,
I'm glad you got it working.
Could you give me the URL to you pages where I can see the error ?

You can post it here or send to support@xlinesoft.com