SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Member
    Join Date
    May 2003
    Location
    mumbai
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy User Download - No Save as

    Hello all,
    Am new in here...

    I am coding for my little project and am not a total pro at this, However our project demands something different.

    Say for example: A user clicks to download a particular file (say an .exe or a .zip) this file must start downloading in a specific folder that I mention.

    The user should not be able to save the file in any folder/directory he/she wants.

    Say I set a path - C:/downloads

    So On Click the file must be downloaded to this particular directory.

    I have seen on a few sites that this is possible, must notably with www.gigex.com

    I have completed my project totally but from the past 8 days I have tried all the possible tricks i knew but I haven't been able to get this done.

    Please help

    Lewis

  2. #2
    SitePoint Addict BenANFA's Avatar
    Join Date
    Apr 2003
    Location
    Bath, UK
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is because gigex run an aplet/browser exention to allow downloads. Unless you are willing to put the time into developing such an application (or finding one available as freeware) I suspect that you are not going to be able to do this.

    Why is it necessary for you to define the directory that the users put the file into ?

  3. #3
    SitePoint Member
    Join Date
    May 2003
    Location
    mumbai
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Benanfa,

    The thing is we need to track who has downloaded our software.

    My company wants a proper tracking format to track the number of downloads that takes place.

    I can script in ASP, VBScript, Javascript

    The solution i worked out is as follows.

    If i predefine the folder then the download takes place in that particular folder only.

    When the user clicks to download the file, a fake progress bar (window) would pop up.
    This window will contain my asp script which is powerful enough to check the folder that I pre-defined to see whether the file exists or not.

    Whenever it is that the internal script(within the pop-up window) detects the download it will say download completed and count 1 - and I'll have proper statistics as to which IP, at what time, date etc downloaded the software.

    I am pretty good at ASP but it's not feisable or rather I ain't capable enough to do what gigex has done. I searched all across the internet to find such a script but no such luck.

    One of my former colleagues told me that Javascript is capable of simply saving it in a particular folder that i mention, but he has left the company and isn't interested in helping me out

    Are you sure Benanfa that the applet is my only option cos i don't think I'd be able to do it and if I am not able to get this done, then I'd loose my job


    Lewis

  4. #4
    SitePoint Addict BenANFA's Avatar
    Join Date
    Apr 2003
    Location
    Bath, UK
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Javascript is not allowed to read or write files on the client side, this is a security precaution, I'm not sure what your colleague was thinking of. I am not sure that an applet is the only way I just can't think of any other way. The normal download method uses ftp and that pops up a dialog box on the client machine that allows you to say where you want the file saved. That is a function of the ftp client you have installed not the html/javascript of the current page.

  5. #5
    SitePoint Member
    Join Date
    May 2003
    Location
    mumbai
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Benanfa - Exactly right, I understand it's the function of the ftp client.

    That's the reason am trying to do something different, and have worked and researched the net for over 13hrs a day for the past week trying to gain info - but dang.

    Regards
    Amit

  6. #6
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not just record statistics on when the link is clicked and live with the +/- 5% error?
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  7. #7
    SitePoint Wizard davidjmedlock's Avatar
    Join Date
    Dec 2002
    Location
    Nashville, TN USA
    Posts
    1,688
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, I think that's what CNET/ZDNET probably does. They track all their downloads, but you always end up on a page that says "Please wait while the download begins. If it doesn't start soon, click here...", etc. They probably increment their counter there.

  8. #8
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ya, if you really needed to track only completed downloads - there's probably an HTTP reponse header that would help
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  9. #9
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by beetle
    Ya, if you really needed to track only completed downloads - there's probably an HTTP reponse header that would help
    AFAIK the browser doesn't send a message back once it has received a file, the server simply finishes sending data.

    However, in a server-side scripting language, you could stream data to the client in a loop (sending a chunk at a time and then checking that the client is still connected - in ASP you can use Response.IsClientConnected for this), and then once you come out of the loop you know you've sent all the data (and the client has received it). Unfortunately, this is an extremely inefficient way to send data - high cpu + memory usage + network bandwidth (all the extra packets to and fro from checking if the client is still there)...
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!

  10. #10
    SitePoint Member
    Join Date
    May 2003
    Location
    mumbai
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not just record statistics on when the link is clicked and live with the +/- 5% error?

    (How i wish I could have done it this way, the most simplest way possible but my boss expects something else)

    davidjmedlock - I suspect they increase their counter as soon as you click on "Download Now" or perhaps when the have that message (pls wait etc etc)

    beetle & M@rco (I'll try to research a bit on what you've both said as I am not quite understanding the instructions given by u 2)

    If you could explain in brief, perhaps I could use some references and get this thing done

    Thanks again

    Lewis


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
  •