Reply to Re: Uploading viles via php

Your name:

Reply:


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.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация