Jump to content

muddflap

Members
  • Posts

    2
  • Joined

  • Last visited

muddflap's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Thanks for the help. I got it working using your example. My other problem was setting write permission to the folder. ><?php if (!is_uploaded_file($_FILES['file']['tmp_name'])) { $error = "You did not select a file to upload"; unlink($_FILES['file']['tmp_name']); } else { if( copy($_FILES['file']['tmp_name'],"upload/".$_FILES ['file']['name']) ) { print "copied"; } else { print "failed"; } } ?> <html> <head></head> <body> <form action="load.php" method="post" enctype="multipart/form-data"> <?=$error?> <br><br> Choose a file to upload:<br> <input type="file" name="file"><br> <input type="submit" name="submit" value="submit"> </form> </body> </html>
  2. I'd like to see a working example if anyone has one <html> <head> <title>doesn't work</title> </head> <?php $file_dir = "/upload"; $file_url = "http://www.mywebsite.com/public_html"; print "path: $fupload<br>\n"; print "name: $fupload_name<br>\n"; print "size: $fupload_size bytes<br>\n"; print "type: $fupload_type<p>\n\n"; copy ( $fupload, "$file_dir/$fupload_name") ; print "<input value=\"$file_url/$fupload_name\"><p>\n\n"; ?> <body> <form enctype="multipart/form-data" action="<?php print $PHP_SELF?>" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="51200"> <input type="file" name="fupload"><br> <input type="submit" value="Send file!"> </form> </body> </html>
×
×
  • Create New...