We currently have an internal web reporting tool that we create asp
reports that pull data from a sql server. I currently created a report
that instead of outputting the report in html format, it generates an
Excel file behind the scenes and saves it on the web server. My
question is this.....how can I get the file to save locally to the
computer of the user running the report instead of saving on the web
server? I tried the following code, but no luck

--current code that saves on the web server

xlWorkbook.SaveAs "\\webserver\storagefolder\Report.xls"

--tried the following

xlWorkbook.SaveAs "C:\Temp\Report.xls"
--or
xlWorkbook.SaveAs "\Temp\Report.xls"


both seem like the work fine, but when I look for the file, it does not
exist.

Can anyone help me out with this?

Re: Create file on external web server and save to local user drive by Hal

Hal
Fri Feb 18 23:01:36 CST 2005


<tjdalton311@hotmail.com> wrote in message
news:1108759581.907520.322000@z14g2000cwz.googlegroups.com...
> We currently have an internal web reporting tool that we create asp
> reports that pull data from a sql server. I currently created a report
> that instead of outputting the report in html format, it generates an
> Excel file behind the scenes and saves it on the web server. My
> question is this.....how can I get the file to save locally to the
> computer of the user running the report instead of saving on the web
> server? I tried the following code, but no luck
>
> --current code that saves on the web server
>
> xlWorkbook.SaveAs "\\webserver\storagefolder\Report.xls"
>
> --tried the following
>
> xlWorkbook.SaveAs "C:\Temp\Report.xls"
> --or
> xlWorkbook.SaveAs "\Temp\Report.xls"
>
>
> both seem like the work fine, but when I look for the file, it does not
> exist.
>
> Can anyone help me out with this?
>

Normally, you can not access the user's filesystem from a web page.
There are exceptions - like signed applets in Java - and probably active-X -
but I would try something else

After your app creates the xls file, why don't you just provide a link to
it - so the user can click and download -or open it.




Re: Create file on external web server and save to local user drive by tjdalton311

tjdalton311
Mon Feb 21 08:37:54 CST 2005

I actually am currently providing the link so the user can download the
file, but this was only a temporary fix, as I would like to avoid
having to store the files out on the web server permanently.


Re: Create file on external web server and save to local user drive by Brian

Brian
Mon Feb 21 10:19:10 CST 2005

> xlWorkbook.SaveAs "C:\Temp\Report.xls"
> --or
> xlWorkbook.SaveAs "\Temp\Report.xls"

Imagine if you were allowed to do that...it would be really easy for any
website to easily put/replace any file on your machine.

It can be done, but you need to pass all sorts of security barriers - browser
rights and folder rights too.

Brian