File upload

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I cant get my php script to upload a file to the default dir. I have
checked all the php.ini variables and made sure there is a default
temporary dir, as soon as i submit it just reloads the page. this is my

<form enctype="multipart/form-data" action="<?php echo
$_SERVER[PHP_SELF]; ?>" method="POST">
    <input type="hidden" name="MAX_FILE_SIZE" value="30000" />
    Send this file: <input name="userfile" type="file" />
    <input type="submit" value="Send File" />

please help me! i dont know what to do!

Re: File upload

the flaw isn't in this part -> the page doesn't reload (i recon) but it
gets posted to itself. Can be a way to do it, but you'll need some php
to handle that.

Assuming your coding is all ok, you also have to make sure that your
permissions are all set to go. Chmod involved dirs and files to 0777,
test it, and if it works, you know the flaw is in that part,,,,,

Re: File upload

im not sure what you mean by Chmod the involved dirs and files to 0777,
and i have looked at that handling file uploads page for hours on end.
For the record im running apache 1.3.3 on a win32 machine with 4.3.9 php

Re: File upload

yeah jus figured out that chmod is a Unix command. wonder if theres a
similar one for windows.

re:File upload

Well this is mainlly because you forgot to add the necessary php
code:), you may want to read here for more

Ovidiu -- Connecting Developers

Site Timeline