• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

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
0
manodeep
Asked:
manodeep
  • 3
  • 2
  • 2
  • +2
1 Solution
 
ksenthilrajCommented:
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
0
 
Michel SakrCommented:
.. 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
%>

0
 
epeeleCommented:
If you are developing a Web-based application for your local intranet, and you want complete control
over the output that your user prints from your Web application, you could just allow the user to click
the print button on their Web browser.

But you ask, "Isn't there a way I can do this from the server?" The answer is YES: print from ASP.

The full details are at MS:

Using ASP and WSH to Print on Your Intranet
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnserv/html/server033099.asp
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Michel SakrCommented:
This is an INtranet solution.. not an internet one.. it's narrowed
0
 
epeeleCommented:
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.
0
 
manodeepAuthor Commented:
hey epeele ,
thanks. i think your solution will work
i have not implemented the code yet
will let you know

manodeep
0
 
epeeleCommented:
You're welcome manodeep! :)
0
 
manodeepAuthor Commented:
hi silvers,
i tried out your solution but ended up displaying the contents in the web browser :(
thanks anyway

manodeep
0
 
puranik_pCommented:

        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  

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now