How I can save file in web server folder’s instead of local client’s folder ?.
Or how I can move a file from local client’s folder to web server’s folder ?
My problem, is that I would like to read a file in local using src , and as you know src only for web server’s files.
Here is my code .aspx:
<IFRAME id=iframePDF style="WIDTH: 720px; HEIGHT: 700px" runat="server"></IFRAME>
Here is Code-Behind :
sFilePath = System.IO.Path.GetTempFileName()
System.IO.File.Move(sFilePath, System.IO.Path.ChangeExtension(sFilePath, ".pdf"))
sFilePath = System.IO.Path.ChangeExtension(sFilePath, ".pdf")
System.IO.File.WriteAllBytes(sFilePath, buffer)
iframePDF.Attributes.Add("src", sFilePath)
The problem is:
sFilePath is a local path , and src can not read local path ?
Thanks for your help,
Ahmed.
You cannot directly interact with the client’s filesystem.
Period.
Instead, you should create an ASHX handler that sends the PDF to the client, then point the
srcto that ASHX.You can pass information to the ASHX handler using the querystring.