a01020304 Posted January 7, 2010 Share Posted January 7, 2010 I have a script that uploads files direct to the server and a specific folder and also one that allows you to download the uploaded files. The upload script works fine in that it uploads the file to the folder., however if I change the config file to the folder the download script uses the file seems to upload fine but when i try and download it, all it wants to do is open the download.php file and not the actual file I uploaded. I have uploaded the scripts to http://gmdesign.org.uk/testfiles These are just the raw scripts I have not changed the upload script to upload files to the download folder. The folder shown as alteredupload, has the upload going directly to the download folder. The screeshots of the download screen and what happens when the altered script is used is attached. I have also uploaded the scripts too. you will be able to see the passwords (in the config file) there as not publishing them on the open forum. What i would like is to have two seperate scripts as one would be for the person uploading the files and the other would be specifically for the downloader. The main problem I am having is getting the uploaded files to download, Any suggestions? [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/187601-script-thats-baffling-me/ Share on other sites More sharing options...
ignace Posted January 7, 2010 Share Posted January 7, 2010 Apparently you haven't set the appropriate headers Quote Link to comment https://forums.phpfreaks.com/topic/187601-script-thats-baffling-me/#findComment-990502 Share on other sites More sharing options...
a01020304 Posted January 7, 2010 Author Share Posted January 7, 2010 Apparently you haven't set the appropriate headers I have no idea what you mean? as i said the scripts work ok alone but its just when i use them together it fails. The only thing thats different is the folders they upload to. Quote Link to comment https://forums.phpfreaks.com/topic/187601-script-thats-baffling-me/#findComment-990518 Share on other sites More sharing options...
ignace Posted January 7, 2010 Share Posted January 7, 2010 Apparently you haven't set the appropriate headers I have no idea what you mean? That proves my point You should have something like: header('Content-Disposition: attachment; filename=' . $filename); See this example at php.net readfile Quote Link to comment https://forums.phpfreaks.com/topic/187601-script-thats-baffling-me/#findComment-990538 Share on other sites More sharing options...
a01020304 Posted January 7, 2010 Author Share Posted January 7, 2010 I do not think you realise the actual issue??? Click on the link I supplied above click on each of the folders, upload and download, you will see both scripts work fine if you click on the folder alteredupload you will also see the script works fine the issue is when i change the config of the upload file from: dir" =>"uploads/folder1/", to dir" =>"../downloads/download/folder1/", the file thats transfered does not download, but the download.php tries to open only. Quote Link to comment https://forums.phpfreaks.com/topic/187601-script-thats-baffling-me/#findComment-990632 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.