For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > September 2006 > upload_tmp_dir









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author upload_tmp_dir
iulian.ilea

2006-09-29, 7:57 am

I have a problem when I upload files: if try to upload files stored in
the same directory whith upload script it is ok, it uploads them on the
ftp. IF I select a file from another directory than the one with tha
php script I get an error: uploadPHP Warning:
ftp_put(langtxt-update.sql) [function.ftp-put]: failed to open stream:
No such file or directory in D:\Atlanticmoon\collaudi\ftp_upload.php on
line 35. I tried to set the upload_tmp_dir in the php.ini to
c/Windows/Temp/ - that is the default. I tried phpinfo() and it is set.
Trying $_FILES["file"]["tmp_name"] I get the correct path. After many
tryes to understand why I get an error, I changed again upload_tmp_dir,
hit an phpinfo() and it changed. At $_FILES["file"]["tmp_name"] in the
script I get the default: windows/temp. What is the problem?

Johnny

2006-09-29, 6:58 pm


"iulian.ilea" <iulian.ilea@gmail.com> wrote in message
news:1159537362.472424.230660@c28g2000cwb.googlegroups.com...
> I have a problem when I upload files: if try to upload files stored in
> the same directory whith upload script it is ok, it uploads them on the
> ftp. IF I select a file from another directory than the one with tha
> php script I get an error: uploadPHP Warning:
> ftp_put(langtxt-update.sql) [function.ftp-put]: failed to open stream:
> No such file or directory in D:\Atlanticmoon\collaudi\ftp_upload.php on
> line 35. I tried to set the upload_tmp_dir in the php.ini to
> c/Windows/Temp/ - that is the default. I tried phpinfo() and it is set.
> Trying $_FILES["file"]["tmp_name"] I get the correct path. After many
> tryes to understand why I get an error, I changed again upload_tmp_dir,
> hit an phpinfo() and it changed. At $_FILES["file"]["tmp_name"] in the
> script I get the default: windows/temp. What is the problem?
>

using ftp you need to use ftp_chdir to change the directory.
AFAIK upload_tmp_dir is for files uploaded by form submission but you are
using ftp. you can check where they go bty default using ftp_pwd.


iulian.ilea

2006-09-30, 3:57 am


Johnny wrote:
> "iulian.ilea" <iulian.ilea@gmail.com> wrote in message
> news:1159537362.472424.230660@c28g2000cwb.googlegroups.com...
> using ftp you need to use ftp_chdir to change the directory.
> AFAIK upload_tmp_dir is for files uploaded by form submission but you are
> using ftp. you can check where they go bty default using ftp_pwd.


But I use form submission.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com