sending a file via HTTP

liunx

Guest
hi all,<br />
<br />
please suggest me a right way of sending an ASCII file via HTTP from one website to another.<br />
<br />
thanks,<br />
yns<!--content-->You can't send via HTTP. <br />
<br />
You can send via FTP or if you are using Unix then via SSH from box to box but not HTTP.<br />
<br />
Ta<br />
<br />
Check this out <!-- m --><a class="postlink" href="http://www.redlinehosts.co.uk">http://www.redlinehosts.co.uk</a><!-- m --><!--content-->well, what I ment is kind of "submit" a file to a page, like the way we can submit a form field.<br />
a cgi-script-language is available on the receiver side, so it won't be a problem to get the file there.<!--content-->try using the subparseform.lib, (just do a search in google you should find it if not let me know) this is if you are asking what I believe you are asking, that is if you create a form with post action and you want info submited to be put into a text file on your server for you to look at or maybe let others view, after you get subparseform.lib its pretty easy, if you want more info about it ask, I can give you some examples from my guestbook I am writing if you want.<br />
<br />
Or if not try this, This script would be run on the system that has access to the files that are to be uploaded.<br />
<br />
Here's a short example:<br />
<br />
#!/usr/bin/perl<br />
use LWP::UserAgent;<br />
use HTTP::Request::Common qw/POST/;<br />
my $ua= LWP::UserAgent->new();<br />
<br />
my $filename='/local/file/to/upload.doc';<br />
my $url='http://the.url.to.post.to/cgi-bin/foo.pl';<br />
<br />
my $request=POST $url , Content_Type=>'form-data',<br />
Content => [HTML_form_file_field_name=>[$filename]];<br />
<br />
my $results=$ua->request($request);<br />
if($results->is_success){<br />
print "It's good!\n";<br />
} else {<br />
print "It didn't work.\n";<br />
print $results->status_line();<br />
}<br />
<br />
Ta<br />
<br />
Check this out <!-- m --><a class="postlink" href="http://www.redlinehosts.co.uk">http://www.redlinehosts.co.uk</a><!-- m --><!--content-->> ..and you want info submited to be put into a text file on your server ..<br />
<br />
there is no problem with that part, the problem appears when I want to send that file (actually an XML file) to another website, where there is a script-language-page awaiting for that file (receiver).<br />
did not want to make the file contents embedded into an html page to make it happen. thought a simpler way should be available.<!--content-->
 
Back
Top