Basic file upload doubt
Moderator: General Moderators
Basic file upload doubt
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
Re: Basic file upload doubt
Code: Select all
<form enctype="multipart/form-data" .....There are 10 types of people in this world, those who understand binary and those who don't
Re: Basic file upload doubt
The forms we use in our project would be typically look like the following
x and y are parsed and then sent to a right action file
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">
Re: Basic file upload doubt
Check you php.ini for file upload permitions.
There are 10 types of people in this world, those who understand binary and those who don't
Re: Basic file upload doubt
I doubted that, but What should I check there?
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
Re: Basic file upload doubt
Would you mind posting the output of var_dump($_FILES) ?
There are 10 types of people in this world, those who understand binary and those who don't
Re: Basic file upload doubt
its an empty array