You are here: Solution Found:Re: PHP and uploading files « HTML « IT news, forums, messages
Solution Found:Re: PHP and uploading files

Posted by Nonee on 11/14/65 11:28

Thank you very much! I did try the multipart thing and that didn't
work last time. Now it does. Have NO idea as to why... lol.

Thanks for the help!

-Josh

On Sat, 24 Sep 2005 11:26:14 +0100, Hywel Jenkins
<hywel.jenkins@gmail.com> wrote:

>In article <mak8j116o1lgi0a1bp99i9dk6gr3vgo6vg@4ax.com>, None@none.com
>says...
>>
>> Hello all,
>>
>> Ok ok, I have searched the internet extensively and I cannot find
>> the answer to this. I have found many answers but none of which that
>> work. I am running an apache server on my end, local for testing, and
>> I have wrote a php page that will accept a file to be uploaded. See
>> below.
>>
>>
>> <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
>> <span class="smHeader">Choose a file to upload: </span></td>
>> <td><input name="uploadFile" type="file" />
>>
>> Then on the added.php file that I post to, I have
>>
>> if ($_POST["password"] == "") // Blank for now so I don't have to
>> type it everytime. Btw, is this secure???
>> {
>> $last = $_POST["last"];
>> mkdir("C:\\apache2triad\\htdocs\\condolences\\".$last);
>> //local file will be replaced when posted
>> echo "Made it! ". $_FILES['uploadFile']['name'];
>> if ( move_uploaded_file ($_FILES['uploadFile']
>> ['tmp_name'],"../uploads/{$_FILES['uploadFile'] ['name']}") )
>> {
>> print '<p> The file has been successfully uploaded
>> </p>';
>> }
>> else
>> {
>>
>> // ...EXCLUDED. JUST USED FOR TESTING THE ERROR
>> }
>> }
>>
>> ?>
>>
>> Notice the echo "Made it!".$files line. It posts the made it part but
>> nothing for the file. Now I created a ../uploads folder (which is in
>> the root, correct? I never could get the . or .. stuff right). But
>> it just will not work. Is it because I am running the server local?
>> Shouldn't be... Or is it something with the php.ini config or apache
>> config? Please help. This is really annoying...
>
>Is your form set up correctly - enctype="multipart/form-data"
>
>The name of the file won't be in $_POST, either. It will be in
> $_FILES["FieldName"]["name"]

 

Navigation:

[Reply to this 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

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