[PHP] upload a file directly to the proper directory
I have to upload files. My scripts don't work with large files. On the "Chapter 19. Handling file uploads" from the php.net doc I found the following comments : [EMAIL PROTECTED] 26-Feb-2002 08:24 When uploading large files, I've found that the memory limit has to be twice as large as the upload limit or else the PHP script will not be able to move/copy the file to a new destination. I guess this explain why I cannot manage large files uploading : The upload is possible but I cannot move the file from the temporary directory. As I cannot increase the memory_limit (my host does not allow it) I am wondering if it is possible to upload the file directly to its proper directory. Thanks for any help. Note : I cannot modify the upload_tmp_dir directive of the php.ini file as others scripts also use it. The manual mentions : "Setting it using putenv() from within a PHP script will not work.". Does it mean that what I want to do is not possible ? My php.ini is set up as follow : max_execution_time = 1 post_max_size = 30M upload_max_filesize = 30M and on my script, the MAX_FILE_SIZE hidden form element is present. Pierre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] upload a file directly to the proper directory
Hi, Bogdan, Thanks for your help. It isn't a SQL error. I do not upload the file to a database. I have been able to upload a 4M file. I really think it is because the memory_limit of the server is 8M. And that means that it doesn't have enough resource to copy the uploaded file from the temporary folder to the proper one. I wanted to have confirmation about that and find a way to solve this problem. Pierre - En réponse à Bogdan Stancescu <[EMAIL PROTECTED]>: > Do you get a PHP or a SQL error? I had this problem, but my problem was > > MySQL, not PHP (i.e. PHP handles uploads > 2MB and MySQL doesn't by > default). The error I got was "MySQL server has gone away" or something > > similar. > > Bogdan > > [EMAIL PROTECTED] wrote: > > >I have to upload files. > >My scripts don't work with large files. > > > >On the "Chapter 19. Handling file uploads" from the php.net doc I found > the > >following comments : > > > >[EMAIL PROTECTED] > >26-Feb-2002 08:24 > >When uploading large files, I've found that the memory limit has to > be > >twice as large as the upload limit or else the PHP script will not be > able > >to move/copy the file to a new destination. > > > >I guess this explain why I cannot manage large files uploading : > >The upload is possible but I cannot move the file from the temporary > directory. > >As I cannot increase the memory_limit (my host does not allow it) I am > > >wondering if it is possible to upload the file directly to its proper > directory. > > > >Thanks for any help. > > > >Note : > >I cannot modify the upload_tmp_dir directive of the php.ini file as > others > >scripts also use it. > > > >The manual mentions : "Setting it using putenv() from within a PHP > script will > >not work.". Does it mean that what I want to do is not possible ? > > > >My php.ini is set up as follow : > >max_execution_time = 1 > >post_max_size = 30M > >upload_max_filesize = 30M > >and on my script, the MAX_FILE_SIZE hidden form element is present. > > > >Pierre > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Header - cache control depends of the server ?
Hi I am using this to make sure a page is refreshed when the user uses the back button of his browser : When I try on local (Win NT) it works. The page is refreshed. When I try on an other server (UNIX) it doesn't work. Is it normal ? Any idea how I can solve this ? Thanks for any assistance. Pierre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Uploading big files
Hi, I need confirmation on this matter : The scripts I use to upload files work fine until the file exceed 7 M. No specific error message appears. The hidden input MAX_FILE_SIZE is included in the scripts. My scripts are running on php 4.1.2. The php.ini file is set up as follow : max_execution_time = 1 memory_limit = 8388608 post_max_size = 30M file_uploads = On upload_tmp_dir = upload_max_filesize = 30M Is it because of the memory_limit that it doesn't work ? Do I have a way to upload files (over 7M) on the server without increasing the memory_limit ? Thanks for your help. Pierre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDF library
Hi everybody, Does anyone know a way to check if a server is able or not to support PHP script including PDF related function ? I guess I need to know if the server has API idoine or something like that. Thanks for your help. Pierre By the way, any good tutorial about creation of PDF file using PHP ? The purpose is to print dynamic table. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP library
Hi everybody, Does anyone know a way to check if a server is able or not to support PHP script including PDF related function ? I guess I need to know if the server has API idoine or something like that. Thanks for your help. Pierre By the way, any good tutorial about creation of PDF file using PHP ? The purpose is to print dynamic table. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PDF library
Hi everybody, Does anyone know a way to check if a server is able or not to support PHP script including PDF related function ? I guess I need to know if the server has API idoine or something like that. Thanks for your help. Pierre By the way, any good tutorial about creation of PDF file using PHP ? The purpose is to print dynamic table. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]