Drewser33 Posted February 20, 2008 Share Posted February 20, 2008 I have accomplished uploading files to my server. I am not grasping how to use the fopen or really any other file system type command. Anyone have a piece of code that makes it easy to download files from the server? Thanks, Drew Quote Link to comment https://forums.phpfreaks.com/topic/92169-downloadingsaving-files-from-server/ Share on other sites More sharing options...
revraz Posted February 20, 2008 Share Posted February 20, 2008 You mean download and save to your HD? You don't need fopen for that, fopen is for reading files. Quote Link to comment https://forums.phpfreaks.com/topic/92169-downloadingsaving-files-from-server/#findComment-472101 Share on other sites More sharing options...
Drewser33 Posted February 20, 2008 Author Share Posted February 20, 2008 To save to the HD preferably. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/92169-downloadingsaving-files-from-server/#findComment-472103 Share on other sites More sharing options...
revraz Posted February 20, 2008 Share Posted February 20, 2008 Just create a link to the filename. Or is that what you are asking how to do? Quote Link to comment https://forums.phpfreaks.com/topic/92169-downloadingsaving-files-from-server/#findComment-472105 Share on other sites More sharing options...
Drewser33 Posted February 20, 2008 Author Share Posted February 20, 2008 Thats what I am unable to do. Thanks I know, stupid. Quote Link to comment https://forums.phpfreaks.com/topic/92169-downloadingsaving-files-from-server/#findComment-472110 Share on other sites More sharing options...
revraz Posted February 20, 2008 Share Posted February 20, 2008 So explain your goal a little better. Do you have a folder where you want to read each filename and list the files in a link to download? Quote Link to comment https://forums.phpfreaks.com/topic/92169-downloadingsaving-files-from-server/#findComment-472114 Share on other sites More sharing options...
Drewser33 Posted February 20, 2008 Author Share Posted February 20, 2008 When the files upload they all go to one folder. So I would like the download to only come from that folder specifically. I will only be able to access this through the web address. I have created a table that holds the file name that pertains to an ID I will only display the link that pertains to that ID so not every file in the folder is being shown. That link will download that file to the users HD. Is this enough detail?? Quote Link to comment https://forums.phpfreaks.com/topic/92169-downloadingsaving-files-from-server/#findComment-472123 Share on other sites More sharing options...
Drewser33 Posted February 20, 2008 Author Share Posted February 20, 2008 OK, I have made a link that will allow me to right click and save link as, and will work correctly, however the file I am testing with is a text file and if I left click on the link it just opens the text on the screen. I was looking for it to ask to save to the users HD Quote Link to comment https://forums.phpfreaks.com/topic/92169-downloadingsaving-files-from-server/#findComment-472141 Share on other sites More sharing options...
revraz Posted February 20, 2008 Share Posted February 20, 2008 Force downloads should work http://www.phpfreaks.com/forums/index.php/topic,95433.0.html Quote Link to comment https://forums.phpfreaks.com/topic/92169-downloadingsaving-files-from-server/#findComment-472144 Share on other sites More sharing options...
Drewser33 Posted February 20, 2008 Author Share Posted February 20, 2008 Alright, I have everything going as planned now when I have a static path to the file I would like. However I would like the file that is displayed to be the one that downloads. echo '<td rowspan = "2"><font face="Arial" size="2"><a href="' . '/uploads/' .'">'. $attach .'</td>'; is what I have and the correct file is displayed as the link, however, if I leave it like this the display on the page offers all of the files inside of the uploads directory. When I put /uploads/$attach it tells me that it isn't a valid file, which is true, but is it possible to use a variable here? or is there something else that I am going to have to do?? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/92169-downloadingsaving-files-from-server/#findComment-472224 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.