bird_man11 Posted February 9, 2007 Share Posted February 9, 2007 Hi i dunno if any one can help but i have a active x control that saves a file to the local hard drive, and with this file i want the file to be uploaded to the server automatically when the use presses submit. I can get the local path to be stored in a variable by running a javascript function but i cannot seem to upload the file. I have tried making a hidden file box and passing the value to it but it keeps passing a black value to the upload php script. is there anyway to have a $_POST variable used in a upload script? any suggestions? this is my upload code $filename = $_POST['filename']; $target_path = 'upload/'; // the directory for the original file $prefixbig = '.OMA'; // the prefix to be added to the original name $target_path = $target_path . $id_no . $prefixbig; $temp = $_FILES['filename']['tmp_name']; if(move_uploaded_file($temp, $target_path)) { echo "The file ".$temp." has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } Quote Link to comment Share on other sites More sharing options...
trq Posted February 9, 2007 Share Posted February 9, 2007 What your trying to do is not possible for security reasons. Quote Link to comment Share on other sites More sharing options...
artacus Posted February 9, 2007 Share Posted February 9, 2007 activeX control! Did you get lost? ASP Freaks is that way ----> Quote Link to comment Share on other sites More sharing options...
trq Posted February 9, 2007 Share Posted February 9, 2007 Did you get lost? ASP Freaks is that way ----> ASP has nothing to do with activex. Quote Link to comment Share on other sites More sharing options...
artacus Posted February 9, 2007 Share Posted February 9, 2007 Yeah? And when was the last time you saw a PHP coder use activex controls??? Exactly. Activex is for the Microsoft minions. Quote Link to comment Share on other sites More sharing options...
camdagr81 Posted February 9, 2007 Share Posted February 9, 2007 Your best bet is to use an ftp batch file that watches your directory for new files then sends them to your host. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.