NetTalk Central

Author Topic: need urgent help "download name" please  (Read 4265 times)

Thomas

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • Email
need urgent help "download name" please
« on: April 29, 2008, 05:46:49 AM »
Hello,
it is really urgent. The User of the prog must download exe files. I want the Browser to ask the user for executing or downloding. I know it's the browsers decision what to do with the file to be downloaded.
Problem: the name of the download procedure is exposed to the Client, not the exe name and thus the option "execute" is missing. The file downloads correctly but as I said it has the name of the procedure. If I rename it to exe everything works well.
Any help apreciated.
TIA, Thomas.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: need urgent help "download name" please
« Reply #1 on: April 30, 2008, 07:13:15 AM »
Hi Thomas,

The server does not specify the name to the browser. The browser "asks" for a name, and ultimately this is the name it uses, since it thinks it's getting what it asked for. As far as I know there's no way to tell the browser "hey, you asked for page xyz, but I'm sending you abc.exe instead."

That said, I don't know for sure that it's impossible. Maybe there's something in the header which one could use to override the name. I'll do some research with google...

Cheers
Bruce


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: need urgent help "download name" please
« Reply #2 on: April 30, 2008, 07:19:02 AM »
Alan Telford posted another answer for you as well (he just got the thread wrong.) See below...

http://www.nettalkcentral.com/index.php?option=com_smf&Itemid=36&topic=288.0;topicseen

Try the above link. It is a slightly different problem, but the solution is the same, in that you need to embed some code in the _SendFile method of the WebHandler procedure.

I have a static link with a name of "datasmart_importsales_sample.csv" which I want to ensure has the option of SAVE AS.
The following is code in my _SendFIle method.

  case SELF.GetPageName(Lower(p_FileName))
  of  'datasmart_importsales_sample.csv'
    p_filename = filepathonly(p_filename) & filenamenoextension(p_filename)
  end

Use the idea and adapt for your needs.
Regards,
Alan
PS Also try a search on _SENDFILE in this forum for other threads on this topic.

Big Ian

  • Newbie
  • *
  • Posts: 31
  • I wonder what happens if I press this button
    • MSN Messenger - ian.holdsworth@gmail.com
    • View Profile
    • Email
Re: need urgent help "download name" please
« Reply #3 on: May 01, 2008, 07:14:23 AM »
Bruce

That's a similar technique to the one I used except I placed the file in /web/download and then verified that the logged in user was the owner (Via a database).

Cheers

P.S.  Why does it always take me 2 attempts to post in here because the forum seems to log me out before I can even fart!!!!
Ian Holdsworth
Ram Ltd