help with php file upload

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   help with php file upload
cybershot
CZ Super Newbie
cybershot has been a member for over 17 year's 17 Year Member
usa.gif oregon.gif
Gender: Male
Website:
Status: Offline
Joined: Jan 31, 2007
0.01 posts per day
Posts: 75
Points: 25
   
i am using this form to upload my files, but i have no idea if i have put it together correctly.

<?php
#### Generated by Module Creator - By Disipal site (www.disipal.net) ####
if (!eregi("modules.php", $PHP_SELF)) {
   die ("You can't access this file directly...");

}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");
$index = 0;
OpenTable();
echo"<form enctype=\"multipart/form-data\" action=\"getfile.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>";
CloseTable();
include("footer.php");

?>

now when i click on the module for the uploader, it does display correctly. everything there is good to go. it's this next bit of code i am not sure that it is doing what it is suppose to do. this is the bit i need help with.
<?php
move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],
       "..//map/uploads/{$_FILES['uploadFile'] ['name']}")

?>


so what i have done is create a folder called uploads and put that in the directory listed. then i placed the code above in the same directory. but when i check the upload folder after submitting an upload, there isn't anything there.
also, is it possible to add a line that will redirect the user after the upload. something that says upload has been successfull, then redirect them to the home page?


Back to top Reply with quote
#2   re: help with php file upload
cybershot
CZ Super Newbie
cybershot has been a member for over 17 year's 17 Year Member
usa.gif oregon.gif
Gender: Male
Website:
Status: Offline
Joined: Jan 31, 2007
0.01 posts per day
Posts: 75
Points: 25
   
thanks all for looking. but i figured it out. the it took several hours but i found that first i needed to enable to write permissions on the folder, i then changed the path using ../map instead of the full [ Register or login to view links on this board. ] stuff. and now it's working.



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum