-
Download .asp files?
I want to write a script that will allow the user to download .asp files, using the querystring for the file to download. Normally if you click on a link (for example, "somepage.asp"), it will display it in the browser. However, I want to write a script that allows you to download it (ex: "download.asp?file=somepage.asp"). Any idea how to do this or any links?
-
Zip it. If your using IIS, it will always process the server side code.
-
I did have a script on my site what will allow you to view the code and even edit and save, My host is being stupid at the moment so It dont work, and also I cant FTP from here at the moment, I will get it to you later if you aint already sorted it.
-
Write an ASP page that sets the content type to plain text and uses the file system object to read and output the ASP file. Or if you're really ambitious, convert it to color-coded html.
-
Try this i wrote
usage..
file.asp?path=c:\inetpub\wwwroot\index.asp
u/n admin
p/w password
the path is the full server path, im not sure if a relative path will work thou. This will open a file in a textarea, and you also have the option to save the file
-
1 Attachment(s)
File didnt attach....just change this to a .asp file.....
-
You could also create a directory that holds your downloadable asp files and turn off the execute permissions.
-
I don't think you are understanding what I mean. Take a look at this page:
http://www.asp101.com/samples/index.asp
If you click on "download the code" a download box comes up with the .asp file as the file to save.
-
They probaly have them files in a non-executable folder just like monte96 said.
-
I dunno, maybe. If I set a folder to just "read" i get a 403.
-
Try turning execute off, and execute scripts off as well
-
I did. I turned off "Execute" and "Scripts" and I get a 403 error.
HTTP Error 403
403.1 Forbidden: Execute Access Forbidden
This error can be caused if you try to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed.
Please contact the Web server's administrator if the problem persists.
-
Sounds like they are passing the filename to a component then..
-
I think you need to just mess with the outputted mime types.
-
Josh: I've been trying that, but I can't get anything to work. Say I am trying to save "test.asp." A download box will come up with "test.asp" in the filename field, but the type is "HTML document." When I click Save, it saves as test.asp with nothing in it. I thought maybe it was because there was only server-side script so I tried it on a HTML file...same thing.
-
They are just reading the file using the FSO Object then Dumping it out as a text file,
Same as reading a text file, you can read a text file with an ASP Page.
Just Dump the text file out to the browser. You can Dynamically create ASP pages and HTML Pages on the fly. I do it all the time. and ASP Page is nothing but a text file just read it and display it back.
-
ummmm, Ok guys, I think this guy is telling us about programming in ASP.....
BOUND4DOOM: Id guess we all do ASP here mate :p
-
Well, I finally figured it out, it was a combination of what JoshT and BOUND4DOOM said.
-
Well how did you do it then?