gordon.c Posted November 1, 2010 Share Posted November 1, 2010 Hi I am using SWFupload plugin and I need the upload directory to change dynamically. The php code for this plugin is <?php $uploaddir = "./uploads/"; $file = $uploaddir . basename($_FILES['uploadfile']['name']); $size=$_FILES['uploadfile']['size']; /* ... */ ?> What I need is to put into the first line something similar to $uploaddir = "./uploads/".$_REQUEST['current_selected_directory']; so that files will be uploaded to current directory or directory I choose at the moment. I tried to use $_REQUEST[] variables which apparently can not be read by the script, I also tried $_SESSION and even $_COOKIE. None of these variables is being read by the script. Do you have any way how to solve this? Thank you Quote Link to comment https://forums.phpfreaks.com/topic/217450-swfupload-help-with-php-part-of-the-upload/ Share on other sites More sharing options...
gordon.c Posted November 5, 2010 Author Share Posted November 5, 2010 anyone help please? Quote Link to comment https://forums.phpfreaks.com/topic/217450-swfupload-help-with-php-part-of-the-upload/#findComment-1130706 Share on other sites More sharing options...
thehippy Posted November 5, 2010 Share Posted November 5, 2010 Files handled by PHP are all temporarily uploaded the the upload_tmp_dir (PHP.ini setting), its the programmers' job to move them to a location of their choosing. As it turns out there's a handy function for moving uploaded files around named move_uploaded_file. Also, for future reference files are uploaded to a server via a HTTP POST method in most circumstances. move_uploaded_file( $_FILES["uploadfile"]["tmp_name"], $CustomPath . $filename); Quote Link to comment https://forums.phpfreaks.com/topic/217450-swfupload-help-with-php-part-of-the-upload/#findComment-1130756 Share on other sites More sharing options...
gordon.c Posted November 7, 2010 Author Share Posted November 7, 2010 Thx for reply, but I was kinda asking something else :-) I need to know how to pass to the plugin some additional variables, please read my question again. Quote Link to comment https://forums.phpfreaks.com/topic/217450-swfupload-help-with-php-part-of-the-upload/#findComment-1131344 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.