Link to home
Start Free TrialLog in
Avatar of manodeep
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
Avatar of ksenthilraj
ksenthilraj

hai,

Put the file in the server as .doc so that when you are opening that it will opened as a word document..

With Cheers
Avatar of Michel Sakr
.. 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\file.doc"
  'send to the client
 Response.ContentType = "application/vnd.ms-word"
Response.BinaryWrite objStream.Read
 objStream.Close : Set objStream = Nothing
%>

ASKER CERTIFIED SOLUTION
Avatar of epeele
epeele
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of manodeep

ASKER

hey epeele ,
thanks. i think your solution will work
i have not implemented the code yet
will let you know

manodeep
You're welcome manodeep! :)
hi silvers,
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