dblayout
|
| Posted: 07/24/2003, 12:27 PM |
|
I need to send a file to a user. I would like to 'send' it to them & their browser pop up the Save As dialog box (like when you purchase & download software). How do I do this in CCS?
Thanks
Chris
|
|
|
 |
glerma
|
| Posted: 07/24/2003, 8:56 PM |
|
This is not really a CCS thing. It has more to do with how browsers handle files and their MIME types. There are several ways to to this. Most browsers will handle files that are not of /text/plain or /text/html MIME type by prompting the user to save the file instead of parsing it. There are also ways to force the download using web server features (such as Apache) that allow you to force certain file MIME types to be downloaded.
I'm not sure what you mean by "sending" a file to someone via a browser. That seems a bit over-the-top, if I understand correctly. The easiest way to "send" the file to a user is to create a link to the file itself. The browser will determine if it can be parsed or not.
I would recommend doing a Google search on MIME Types and how they are handled by your web server and browsers.
|
|
|
 |
glerma
|
| Posted: 07/24/2003, 9:04 PM |
|
An example of handling MIME Types would be Apache's mime.types file, which stores all of the MIME Types you can tell httpd which files to try to read and not read. If the mime type is not listed in the file, it will force the download of the file.
|
|
|
 |
RonB
|
| Posted: 07/25/2003, 4:53 AM |
|
Just set the header (php) to the file type or use javascript with an onload event in the body(<body Onload="document.location.href='./somefile.pdf'"
Ron
|
|
|
 |
dblayout
|
| Posted: 07/25/2003, 2:07 PM |
|
In my code, in the Before Show event I create a file on the server. After it is created, I am sending the user an email (done!) and I need to allow for downloading the file. I guess I could just put a link on my 'thank you' page and they could click there to download it but I was hoping that I could bypass that step and just kind of force (push) the file to them, which would obviously open up the Save As window on their browser. I tried doing a redirect = "123.xls" but that didn't seem to do anything. BTW, I am using ASP.
Thanks
Chris
|
|
|
 |