Page 1 of 1

Mac build-in Apache upload problem with Safari

Posted: Wed Jun 17, 2009 3:35 am
by stanlund
Hello

I was struggling to get a tutorial upload script to work on my Mac build-in Apache. With virually no success until I tried to access the page with Firefox (version 3.0.5) And upload went just fine. Question is what's wrong with Safari (version 4.0 5530.17) and what should I do to make it work?

Here are those very simplistic upload scripts:

Code: Select all

<form enctype="multipart/form-data" action="uploader.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
 

Code: Select all

<?
$target_path = "uploads/";
 
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 
 
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['uploadedfile']['name']). 
    " has been uploaded";
} else{
    echo "There was an error uploading the file, please try again!";
}
?>