Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Downloading Files on my ASPlogin web site
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Downloading Files on my ASPlogin web site

 Post Reply Post Reply
Author
Justinh View Drop Down
Newbie
Newbie


Joined: 14 July 2008
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Justinh Quote  Post ReplyReply Direct Link To This Post Topic: Downloading Files on my ASPlogin web site
    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
%>

Edited by Justinh - 25 July 2008 at 2:43pm
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Justinh View Drop Down
Newbie
Newbie


Joined: 14 July 2008
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Justinh Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
123Simples View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 July 2007
Location: United Kingdom
Status: Offline
Points: 1192
Post Options Post Options   Thanks (0) Thanks(0)   Quote 123Simples Quote  Post ReplyReply Direct Link To This Post Posted: 25 July 2008 at 5:05pm
Is it perhaps the fact that your server only allows a 35 character limit on filenames?
Back to Top
Justinh View Drop Down
Newbie
Newbie


Joined: 14 July 2008
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Justinh Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
123Simples View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 July 2007
Location: United Kingdom
Status: Offline
Points: 1192
Post Options Post Options   Thanks (0) Thanks(0)   Quote 123Simples Quote  Post ReplyReply Direct Link To This Post 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:
Encoding filename
File Uploading using ASP
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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.