problems with file upload
Posted: Tue Apr 22, 2003 7:37 am
i am running php 4.06 on Apache Server in a Win ME system. I
am trying to debug a file upload script but it doesnt work. The
form i use is a classical file upload form with code:
I have 3 questions:
1) When I try to upload a jpg file by submitting the form, I get the
following variable values: $userfile ="none"., $userfile_size=0 .
The $userfile_name and $userfile_type variables have correct
values. It seems that no file is uploaded to the temp file upload dir
of the apache server. I have checked the php.ini directives (and
the file size) and I have tried different path formats in the
upload_tmp_dir directive (e.g. "C:\WINDOWS\TEMP"/tmp, "C:
\WINDOWS\TEMP", "C:\\WINDOWS\\TEMP", "C:/WINDOWS/
TEMP" or the default php upload tmp directory) but none of these
work.
Do you think there is a problem with Apache running on Windows
or is it something else?
2) Also, when I try to pass some other variables with this multipart
form, their values dont pass across. (e.g. if i use a url
propagation, action="upload.php?var1=$value1", or pass a
variable through a hidden input, I get an undefined $var1 variable
in the upload.php script, although it should normally pass)
3) the upload script "upload.php" (which is the action attr of the
form) has a call to a function1 which has a call to function2. When
I try to debug the upload procedure in PHPEd (with debugging
On of course), it debugs ok during the first lines of the script, but
when it reaches the lines with the call to function1, something
returns false, and the debugging stops, i.e. I get the final output
without having stepped through the lines of the functions that are
called. Therefore, I cant figure out where the bug is. Even if I add
a breakpoint, the phpEd doesnt stop there but it continues to the
end of the script. Is there a way to make the phpEd debug
through these lines as well?
I know these are a lot of questions but I really have tried hard. I
appreciate any help.
am trying to debug a file upload script but it doesnt work. The
form i use is a classical file upload form with code:
Code: Select all
<html>
<head>
<title>Administration - upload new files</title>
</head>
<body>
<h1>Upload file</h1>
<form enctype="multipart/form-data" action="upload.php"
method=post>
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
Upload this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
<input type="hidden" value="somevalue">
</form>
</body>
</html>1) When I try to upload a jpg file by submitting the form, I get the
following variable values: $userfile ="none"., $userfile_size=0 .
The $userfile_name and $userfile_type variables have correct
values. It seems that no file is uploaded to the temp file upload dir
of the apache server. I have checked the php.ini directives (and
the file size) and I have tried different path formats in the
upload_tmp_dir directive (e.g. "C:\WINDOWS\TEMP"/tmp, "C:
\WINDOWS\TEMP", "C:\\WINDOWS\\TEMP", "C:/WINDOWS/
TEMP" or the default php upload tmp directory) but none of these
work.
Do you think there is a problem with Apache running on Windows
or is it something else?
2) Also, when I try to pass some other variables with this multipart
form, their values dont pass across. (e.g. if i use a url
propagation, action="upload.php?var1=$value1", or pass a
variable through a hidden input, I get an undefined $var1 variable
in the upload.php script, although it should normally pass)
3) the upload script "upload.php" (which is the action attr of the
form) has a call to a function1 which has a call to function2. When
I try to debug the upload procedure in PHPEd (with debugging
On of course), it debugs ok during the first lines of the script, but
when it reaches the lines with the call to function1, something
returns false, and the debugging stops, i.e. I get the final output
without having stepped through the lines of the functions that are
called. Therefore, I cant figure out where the bug is. Even if I add
a breakpoint, the phpEd doesnt stop there but it continues to the
end of the script. Is there a way to make the phpEd debug
through these lines as well?
I know these are a lot of questions but I really have tried hard. I
appreciate any help.