Print Page | Close Window

Downloading Files on my ASPlogin web site

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=25998
Printed Date: 29 March 2026 at 3:12am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Downloading Files on my ASPlogin web site
Posted By: Justinh
Subject: Downloading Files on my ASPlogin web site
Date Posted: 25 July 2008 at 2:40pm
I have a .asp web site that uses asplogin. I have 100's of files that users download. For some reason or download method only allows files names with 35 characters max. That includes spaces and file name extension. Any ideas on how I might be able control that to allow longer file names?

Example of download code:

<%

' This script will log a request for a file, and redirect to the appropriate file to
' download it.

' Retrieve FileInfo and page values from request

Dim ftpUsername
Dim ftpPassword
Dim szFileInfo
Dim szPage
szFileInfo = Request.QueryString("FileInfo")
szPage = Request.QueryString("Page")
ftpUsername="xxxxxx"
ftpPassword="xxxxxx"

' Figure out which file to download
Dim szFileName

Select Case szFileInfo
Case "23hgf6587"
   szFileName = "shortfilename.pdf"

End Select
' Set variables for log, then include log file to save record
Notes = "File Download: " & szFileName
PageName = szPage
%>

<!--#include virtual="/log.asp"-->

<%
' Begin file download
Response.Redirect "ftp://"& ftpUsername & ":" & ftpPassword & "@ftp.xxxxx.com/" & szFileName
%>



Replies:
Posted By: WebWiz-Bruce
Date Posted: 25 July 2008 at 3:12pm
This doesn't appear top be a very good way to protect files from being downloaded. Anyone knowing the link can download the file directly.

What you want to do is have a look instead at placing the files on the server were they can not be reach using a web browser, then use the ADO.Steam object to stream the file to the browser. This way you can add password security to a file so only certain users can download the file and direct links would not work.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: Justinh
Date Posted: 25 July 2008 at 4:41pm
Thanks for the help. Hmm, you didn't really help with my question. The way I have it built is working. I just want to control the length of files names.


Posted By: 123Simples
Date Posted: 25 July 2008 at 5:05pm
Is it perhaps the fact that your server only allows a 35 character limit on filenames?

-------------
http://www.123simples.com/" rel="nofollow - Visit 123 Simples Web Design


Posted By: Justinh
Date Posted: 25 July 2008 at 9:30pm
I wish that was the case. I know the windows part allows 255 characters and I asked our server guy to check any settings in IIS6 and he said he didn't see anything. Where on server could he look?


Posted By: 123Simples
Date Posted: 26 July 2008 at 2:49pm
I'm not very up on this type of asp issue, but using some keywords of your original question, I did find a few sites that explained some in depth sh!t which went right over my head, but will probably make sense to yourself:

Sites are:
http://www.codeproject.com/KB/aspnet/NonUSASCII.aspx - Encoding filename
http://www.developer.com/net/asp/article.php/3097661 - File Uploading using ASP
http://www.koders.com/asp/fid38E2F064E2054C64CF862F37537018CADDF7F498.aspx?s=smtp+server - More files using ASP

Now I'm not sure of any of these 3 help or point you in the right direction or not, but looking but at your dim statements, I cant see if you should not have one to dim the actual filename length, rather than just the fileinfo

Sorry but that's all I could come up with Ermm


-------------
http://www.123simples.com/" rel="nofollow - Visit 123 Simples Web Design



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net