|
-
Jul 2nd, 2001, 04:14 PM
#1
Thread Starter
Fanatic Member
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?
Alcohol & calculus don't mix.
Never drink & derive.
-
Jul 3rd, 2001, 02:03 AM
#2
Frenzied Member
Zip it. If your using IIS, it will always process the server side code.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Jul 3rd, 2001, 04:44 AM
#3
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.
-
Jul 3rd, 2001, 06:12 AM
#4
Black Cat
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.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Jul 3rd, 2001, 09:16 AM
#5
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
-
Jul 3rd, 2001, 09:19 AM
#6
File didnt attach....just change this to a .asp file.....
-
Jul 3rd, 2001, 02:16 PM
#7
Frenzied Member
You could also create a directory that holds your downloadable asp files and turn off the execute permissions.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Jul 3rd, 2001, 03:43 PM
#8
Thread Starter
Fanatic Member
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.
Alcohol & calculus don't mix.
Never drink & derive.
-
Jul 4th, 2001, 03:16 AM
#9
They probaly have them files in a non-executable folder just like monte96 said.
-
Jul 4th, 2001, 02:40 PM
#10
Thread Starter
Fanatic Member
I dunno, maybe. If I set a folder to just "read" i get a 403.
Alcohol & calculus don't mix.
Never drink & derive.
-
Jul 5th, 2001, 03:19 AM
#11
Try turning execute off, and execute scripts off as well
-
Jul 5th, 2001, 01:29 PM
#12
Thread Starter
Fanatic Member
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.
Alcohol & calculus don't mix.
Never drink & derive.
-
Jul 5th, 2001, 01:59 PM
#13
Frenzied Member
Sounds like they are passing the filename to a component then..
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Jul 5th, 2001, 01:59 PM
#14
Black Cat
I think you need to just mess with the outputted mime types.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Jul 5th, 2001, 02:40 PM
#15
Thread Starter
Fanatic Member
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.
Alcohol & calculus don't mix.
Never drink & derive.
-
Jul 5th, 2001, 04:03 PM
#16
Lively Member
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.
-
Jul 5th, 2001, 04:39 PM
#17
ummmm, Ok guys, I think this guy is telling us about programming in ASP.....
BOUND4DOOM: Id guess we all do ASP here mate
-
Jul 5th, 2001, 09:26 PM
#18
Thread Starter
Fanatic Member
Well, I finally figured it out, it was a combination of what JoshT and BOUND4DOOM said.
Alcohol & calculus don't mix.
Never drink & derive.
-
Jul 6th, 2001, 03:31 AM
#19
Well how did you do it then?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|