FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP uploads





kingy2k6
I have created a simple PHP script and HTLM form to allow users to upload photos. However, $_FILES['tmp_name'] is always empty. Why is this? Are php uploads allowed?
afracsass
do you mean frih.net? Yes, php upload is allowed.
please post how you created form and php upload script.

I posted a simple form and php script to upload a file.
compare yours with the code below


Form:
Code:

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


php:
Code:

<?php

// Where the file is going to be placed
$target_path = "./";
$ufilename = $_FILES['uploadedfile']['name'];

$uploadfile = $target_path.$ufilename;

if($ufilename != ""){
print "<pre>";
if (move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $uploadfile)) {
   print "Upload success notice goes here.\n";
   print_r($_FILES);
} else {
   print "Upload fail notice goes here.\n";
   print_r($_FILES);
}
print "</pre>";
}
?>



good luck!
Related topics
MyBB and CHMOD with myAdmin
File upload with PHP, Build an upload database for your site
PHP image uploads with progress bar AND resizing? [Resolved]
PHP script trouble
php upload issue
PHP-NUKE install
Matrix Digital Rain animation in PHP
PHP Snippet
PHP and MySQL FAQ - Read Before posting!
Error with MySQL and PHP script in my CMS
Help with php email
PHP and images
http://tuvanonline.com/library/index.php
PHP-Nuke platium?
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.