Problem with file upload ...

A

Anonymous

Guest
---------------------------------------------

This is part of my form Html:


<input type="hidden" name="MAX_FILE_SIZE" value="100000">
&nbsp<INPUT class="bluefldclass" TYPE="file" Name="fotopath" Value="" style="width: 240pt"></TD>
</tr>
<TR><td colspan="4" align="center"><br><INPUT CLASS="bluefldclass" TYPE=SUBMIT Name="submit" Value="Continue" style="width: 100pt">



... and the respective Php:

$file_src = $DOCUMENT_ROOT."/fotot/".$HTTP_POST_FILES['fotopath']['name'];
if (is_uploaded_file($fotopath)) {
move_uploaded_file($fotopath, $file_src);
chmod($file_src, 0644);}



The upload doesn't work! It recognizes the name of the file, but it doesn't upload the file.

---------------------------------------------
 
-------------------------------------------------------

I'm asking to the hosting company but without any answer yet.

Can I check it myself?

-------------------------------------------------------
 
sure... FTP client should allow you to right click on a folder and check what chmod do you have... no need to ask a hosting company because you have permisions to do that manualy, but you need to allow your script to do that..
 
-------------------------------------------------

For the directory "fotot" I have these rights:

owner rw
group rw
others rw

The script still doesn't work! :(

-------------------------------------------------
 
Code:
$file_src = $_SERVER['DOCUMENT_ROOT']."/fotot/".$_POST['fotopath']['name'];

if (is_uploaded_file($_POST['fotopath'])) {
move_uploaded_file($_POST['fotopath'], $file_src);
chmod($file_src, 0644);
}
 
------------------------------------------------

It passes to the else block (so is_uploaded_file($_POST['fotopath'])='false')

:help:

------------------------------------------------
 
--------------------------------------------

The same result! :(

--------------------------------------------
 
-----------------------------------------

It prints all the data of the array $_FILES['fotopath'] exactly but it doesn't recognize it as uploaded ...

:shock:

-----------------------------------------
 
--------------------------------------------

Solved finally!

It was just a matter of permissions. :)

Thank you!

--------------------------------------------
 
I have a question.

How I can make a "Browse..." button for an uploading form ? Thanks.
 
Make something like this:
Code:
<input type='file'>

It will have the browse button beside it.
 
I don't understand. I want a button that opens "browse file" window. Is that the code ?
 
Back
Top