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!"; } Link to comment https://forums.phpfreaks.com/topic/37689-solved-uploading-a-file-without-a-file-field/ 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. Link to comment https://forums.phpfreaks.com/topic/37689-solved-uploading-a-file-without-a-file-field/#findComment-180298 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 ----> Link to comment https://forums.phpfreaks.com/topic/37689-solved-uploading-a-file-without-a-file-field/#findComment-180307 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. Link to comment https://forums.phpfreaks.com/topic/37689-solved-uploading-a-file-without-a-file-field/#findComment-180312 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. Link to comment https://forums.phpfreaks.com/topic/37689-solved-uploading-a-file-without-a-file-field/#findComment-180321 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. Link to comment https://forums.phpfreaks.com/topic/37689-solved-uploading-a-file-without-a-file-field/#findComment-181032 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.