embedding vars into httpd upload form (post method)
| From: | kris at grinz dot com | Date: | Thu, 26 Oct 2000 20:42:13 +0000 |
| Subject: | embedding vars into httpd upload form (post method) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-22207@lists.php.net to get a copy of this message | ||
Hi,
First of all, My server info is: Apache/1.3.12 (Unix) PHP/4.0.2
mod_fastcgi/2.2.8
I am trying to create a list of submit buttons to keep the user from
having to browse for the files before clicking submit. The files will
always be the same name, type and location on the remote user's
HD (c:\windows\desktop\files\file.txt, file2.txt, etc.) The only
difference may be the file size.
Here is my form.. then onto the problem.
<FORM ENCTYPE="multipart/form-data" ACTION="upload.php3"
METHOD=POST>
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="100000">
<INPUT
type="hidden" NAME="userfile" TYPE="file"
value="C:\WINDOWS\Desktop\Grandma.jpg">
<INPUT TYPE="hidden" NAME="userfile_type"
value="image/pjpeg">
<INPUT TYPE="submit" VALUE="Update Grandma">
</FORM>
When the user clicks submit, I have upload.php3 setup very
simple. It just outputs the vars and copies the file from /var/tmp/ to
the final destination on the server filesystem.
Here is the output from upload.php3:
tempfile: c:\\WINDOWS\Desktop\\Grandma.jpg
Origfile :
Filesize:
Filetype:image/pjpeg
If I have the user input c:\WINDOWS\Desktop\Grandma.jpg
into a standard form where you have a browse button, then
submit, it works properly, ie. the output is:
Tempfile: /var/tmp/phpH11549
Origfile: Grandma.jpg
Filesize: 24739
Filetype: image/pjpeg
I dont understand a) why are extra \ back slashes being put in by
PHP and b) why is it not creating a file in /var/tmp like a
standard http upload form would do? I have RTFM'd and
apparently missing something but I dont know what. Has
anybody else tried to do something like this? Any suggestions
are GREATLY appreciated.
Thanks,
Kris