manodeep
asked on
getting server side files from the client end ?
hi all,
i want to retrieve a server side file (text file) from the client end. the "download file dialog (with the option for save this file to disk and run thsi program from its current location)" should not appear and the file should be directed into the printer
thanks in advance,
manodeep
i want to retrieve a server side file (text file) from the client end. the "download file dialog (with the option for save this file to disk and run thsi program from its current location)" should not appear and the file should be directed into the printer
thanks in advance,
manodeep
.. you can't do all this.. wither display the file content in the html body and use window.print() on the onload event of the body tag.. or flush the document using an ado stream and let the client print it..
<%
Set objStream = Server.CreateObject("ADODB .Stream")
'open the file
objStream.Type = adTypeBinary
objStream.Open
objStream.LoadFromFile "C:\Inetpub\wwwroot\docs\f ile.doc"
'send to the client
Response.ContentType = "application/vnd.ms-word"
Response.BinaryWrite objStream.Read
objStream.Close : Set objStream = Nothing
%>
<%
Set objStream = Server.CreateObject("ADODB
'open the file
objStream.Type = adTypeBinary
objStream.Open
objStream.LoadFromFile "C:\Inetpub\wwwroot\docs\f
'send to the client
Response.ContentType = "application/vnd.ms-word"
Response.BinaryWrite objStream.Read
objStream.Close : Set objStream = Nothing
%>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This is an INtranet solution.. not an internet one.. it's narrowed
That's what I said in line 1:
>> If you are developing a Web-based application for your local intranet
But thanks for highlighting it again, Silvers5, for those who may have skimmed over it the first time.
>> If you are developing a Web-based application for your local intranet
But thanks for highlighting it again, Silvers5, for those who may have skimmed over it the first time.
ASKER
hey epeele ,
thanks. i think your solution will work
i have not implemented the code yet
will let you know
manodeep
thanks. i think your solution will work
i have not implemented the code yet
will let you know
manodeep
You're welcome manodeep! :)
ASKER
hi silvers,
i tried out your solution but ended up displaying the contents in the web browser :(
thanks anyway
manodeep
i tried out your solution but ended up displaying the contents in the web browser :(
thanks anyway
manodeep
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
-> Accept epeele's comment as answer
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
puranik_p
EE Cleanup Volunteer
Put the file in the server as .doc so that when you are opening that it will opened as a word document..
With Cheers