Basic file upload doubt
Posted: Tue Oct 14, 2008 2:34 pm
Can't a I put a file upload in a normal POST form? I tried this I always get $_POST['file-form-variablename1'] but not anything in $_FILES
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<form enctype="multipart/form-data" .....Code: Select all
<form enctype="multipart/form-data" action='index.php?x=manager&y=event' name='event' method="post" onSubmit="return checkForm();">
<input type="text" name="first_field_value" value=''>
<input type="text" name="second_field_value" value=''>
<input type="file" name="uploadedfile">
<input type="submit" name="submitButton" value="Submit">
Code: Select all
;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;
; Whether to allow HTTP file uploads.
file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir = "\xampp\tmp"
; Maximum allowed size for uploaded files.
upload_max_filesize = 32M
;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;
; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On
; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
allow_url_include = Off
; Define the anonymous ftp password (your email address)
;from="john@doe.com"
; Define the User-Agent string
; user_agent="PHP"
; Default timeout for socket based streams (seconds)
default_socket_timeout = 60
; If your scripts have to deal with files from Macintosh systems,
; or you are running on a Mac and need to deal with files from
; unix or win32 systems, setting this flag will cause PHP to
; automatically detect the EOL character in those files so that
; fgets() and file() will work regardless of the source of the file.
; auto_detect_line_endings = Off