webclient uploadfile perl cgi

M

marfi95

Hello all.

I'm not sure if this is the correct place to post this, but if not
please let me know.

This is my situation. I have a simple problem, but am having problems
doing this. I'm basically trying to upload a file from my .net app
running on my local pc to a unix webserver (running iplanet). Just
upload and store the file, thats it. I'm using webclient.uploadfile on
the client side. Since its an iplanet webserver, I cant use ASP.

I was looking into using a cgi perl script to capture the file and
write it out, but I'm not fluent in Perl, so I'm struggling there. Is
there a better way to do it ?

I found some cgi scripts that seem to expect the data come from
something like the following: I'm not coming from a browser, but an
application, so I'm not sure how to use this when passing the data
using webclient or httpwebrequest.

example:
<form method="POST" enctype="multipart/form-data"
action="../cgi-bin/fetchfile2.pl">
<p>
<input type="file" name="FileName" size="20"></p>
<p><input type="submit" value="Submit" name="B1"><input type="reset"
value="Reset" name="B2"></p>
</form>

How do I use the above, but from a webclient or httpwebrequest apis ?

Or maybe there is a better way ?

Any helpful information would be most appreciative.

Mark
 
M

m.posseth

well you could do 2 things


1 . the easy one :) switch to FTP

2. also easy ,,,, post the file with you webclient , now with your web
project retrive it with a request.form("paramname") and write it out to a
file
when doing this with binary`s you might forse encode and decodebase64
the data

ofcourse the above both asumes you have the apropriate rights on the server

regards

Michel Posseth [MCP]
 
M

marfi95

well, I got some results anyway. I'm using a cgi script with
query->param to get the file data.

on the client side, I'm using a webclient object and the upload values
method. In the collection passed, I just loaded a string with the
whole file contents. However, for some reason, it only will send about
half of a 7k file. When I try to send the whole file, I get a timeout
error on the webclient request.

Is there a way to send the contents of the file through a
httpwebrequest object, but in a collection so the cgi script can pick
it up ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top