SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    germany
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    File Download Issue -Urgent plz

    Hello
    I have a requirment where i should provide link to user to download certain files.
    I want to hide the information from the user the link details.
    So i use FSO like this but it gave error plz let me know what i am doing wrong

    Set oFS = Server.CreateObject("Scripting.FileSystemObject")
    Set oStream = Server.CreateObject("ADODB.Stream")
    oStream.Open
    oStream.Type = 1
    oStream.LoadFromFile DwnRs.fields("DownloadLink")
    response.contenttype = "application/binary"
    response.binarywrite oStream.read
    DwnRs.fields("DownloadLink") will contains the url from which the file can be downloaded.
    it can be any url irrespective of the server in which the asp page resides.
    eg DwnRs.fields("DownloadLink")=http://www.sitepoint.com/helpneeded.exe

    thanks in advance
    with regards
    vimal
    Knowledge is all about Sharing

  2. #2
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    germany
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the error which i am getting is
    Error Type:
    ADODB.Stream (0x800A0BBA)
    File could not be opened.
    Knowledge is all about Sharing

  3. #3
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    germany
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if i use
    response.redirect(http://www.sitepoint.com/helpneeded.exe)
    is it a must that the server should be installed with IIS?

    with regards
    vimal
    Knowledge is all about Sharing

  4. #4
    SitePoint Evangelist
    Join Date
    Sep 2003
    Location
    San Diego, CA
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are the files hosted localy on the server or on other domain names?

  5. #5
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    germany
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Due to traffic and band width problem, files are in different servers.
    and i store the link of the file name in the database.
    with regards
    vimal
    Knowledge is all about Sharing

  6. #6
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    If you are sending the user to a URL then yes IIS or some type of web server must be installed and running. Is that an example of the path you are sending the user to?

  7. #7
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    germany
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am not showing the url to the user, if it means then problem would be solved where i just give the link in a <a></a> tag.
    But what my problem is , i should hide the path of the server where the file is coming from, and so i planned to send via asp FSO object binary method.But it didnt work and the code which i used, i have put in first message of this thread.
    When i used response.redirect() it worked.but my question is weather it will work in all webserver which dont have iis also.
    with regards
    vimal
    Knowledge is all about Sharing

  8. #8
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think the problem is that the file isn't sitting with the code on the same machine, and your trying to use an address like "http://blah.com/file.exe", yeah? If so, I don't think the code is going to work...

    I may be wrong, I've never tried that with ASP, nor ASP.NET for that matter...


  9. #9
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dhtmlgod is not wrong you must refer to local files not remote files.

  10. #10
    SitePoint Evangelist
    Join Date
    Sep 2003
    Location
    San Diego, CA
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could probably make something using XMLHTTP and binarywrite...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •