View Full Version : file path code

11-20-2005, 10:44 PM
Hello again, I was wondering if anyone knew if it is possible to have a download automaticly go to a preset file path? for example: Having someone click the download link and have it go to a folder that I set in the html.

11-21-2005, 06:42 AM
How do you know what folders are on the user's computer?

11-21-2005, 11:50 AM
I was wondering if anyone knew if it is possible to have a download automaticly go to a preset file path?No, that would be a security risk.

Someone could, for example, name a file explorer.exe and default the path to C:\Windows. It's almost guaranteed that some unobservant user would accept these defaults, and that would be catastrophic on a Windows operating system, and even some Windows NT[1] installations.

The other reason, besides what John wrote, is that different operating systems have very different file system structures. Unix (and similar) don't have a concept of drives, for instance.


[1] C:\WinNT is a common path for NT installations, but C:\Windows is also possible. That directory should be read-only to non-administrative users, but unfortunately, some don't create separate user accounts so they'd still be vulnerable.

11-23-2005, 01:18 AM
I see your point. I am not some trouble maker trying to destroy people's windows. I wanted to use this code my psp site PSP for downloading mpeg4 video files. Since these video files have to go to a specific folder in the psp, I thought I would make it easier to download them for all my users.

I would understand if you think it would be a bad idea to offer anyone a code like that if it did exist.

11-23-2005, 01:54 PM
We're not saying you are. The point is, someone else could be. This is why the creators of browsers wouldn't include the means to do such a thing.

11-23-2005, 08:05 PM
You could always parcel up the files with an installer program and that would allow you to set a default installation path. The user would have an opportunity to select their own location during the install if it didn't match their own hardware setup.

11-24-2005, 01:36 AM
no, it's okay. I dont think I could script an
installer program that could work on a psp.
i guess I would have to trust people not to
screw up the file path when they download
my stuff. thanks for your help guys.

11-24-2005, 05:37 AM
Yes, that is how it is done. Wether a live install or an install from either a downloaded installer or bootstrap file, the developer trusts the user to make the correct choices as to paths and other options. If some aspect of the install is critical, this should be spelled out clearly, both on the page where the download is available and on all pages that have a direct link to it.

11-24-2005, 07:44 PM
of course