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

sending a file back to the client

Hi there

I am trying to write a perl/cgi script we can use on our LAN to read a file do some stuff with it and then place the file back on the client (user) pc (in the directory they supply)

To get the file seems easy enough by using the "file" HTML field.

I have scratched around quite a bit and cannot seem to find an example on how to place the "final" file back to the client.

Help would be greatly appreciated
thanxs
0
tarantino
Asked:
tarantino
1 Solution
 
TintinCommented:
You essentially have to get the client to save the file in the correct location.

Depending on the file type, just send the correct MIME type, eg:

print "Content-Type:  application/octet-stream\n\n";

0
 
tarantinoAuthor Commented:
Thank you Tintin
That helped, as I can figure: print "Content-Type:  application/octet-stream\n\n"; is used to open the "save file to disk" dialogue. I just need to still figure out how to link the correct file to it, but that should be easier to do, now that I learned something new in this already very new-to-me invironment of CGI.

thanks again

0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now