|
Posted by Jacob3D on 06/07/07 08:04
On Jun 7, 3:22 am, TheReckter <TheReck...@gmail.com> wrote:
> Hello, I tried uploading a file via the following method, however it
> does not work, I was wondering what I did wrong as I can not see it.
>
> form.html
> <form action="upload.php" method="post" enctype="multipart/form-data">
> <input type="file" id="file" />
> <input type="hidden" value="hey" id="joe" />
> <input id="submit" type="submit" value="Upload" />
> </form>
>
> upload.php
> <?php
> print_r($_FILES);
> ?>
More than likely you will need to set the MAX_FILE_SIZE in your HTML
form to allow you to upload the file. Make sure you add this prior to
the file input field, and the value is in bytes so 1024 bytes is equal
to 1KB and 1048576 bytes is equal to 1MB. Also for the file input
field make sure you use name instead of id:
<form action="upload.php" method="post" enctype="multipart/form-
data">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000" />
<input type="file" name="file" />
<input id="submit" type="submit" value="Upload" />
</form
Hope that this helps.
Navigation:
[Reply to this message]
|