473,416 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

webclient uploadfile perl cgi

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

Nov 23 '05 #1
2 2189

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]

"marfi95" <ma*****@gmail.com> schreef in bericht
news:11**********************@g49g2000cwa.googlegr oups.com...
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

Nov 23 '05 #2
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 ?

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Federico Bari | last post by:
I have the necessity to send an xml file to a CGI application using the https protocol (then the CGI application have to store the datas of the xml file in a mySQL database). I saw the useful...
0
by: David W | last post by:
I am trying to upload a file from a user's system to my web server. I found code using the WebClient.UploadFile method. However, the uploaded file is from the server's hard drive not the user's...
0
by: Saverio Tedeschi | last post by:
Hi all gurus, forgive me if I submit a 2nd post, but I'm no more able to see my question. So: I wrote an Win app with embedded FTP client (well, made some cut and paste from others' projects :-))...
1
by: Phillip N Rounds | last post by:
I'm having problems using the WebClient.UploadFile() command. I have MySender.ASPX which is supposed to upload two files to the server. There is also ConsumeFileUpload.aspx which is intended to...
0
by: Mihaly | last post by:
I have a WinForms 1.1 application and I want to post some files on the webserver, using WebClient.UploadFile() method. I try the solution from MSDN site -...
12
by: shantanu | last post by:
Hi i am trying to upload a txt file thru this code, but its not updating the data. is this code fine. Or can anybody please suggest me some other meathod to do the same. its urgent please help ...
5
by: Svinja | last post by:
Hi, i am using WebClient.UploadFile to upload a file on my web page, code: WebClient webClient = new WebClient(); webClient.Credentials = new NetworkCredential(userName, pass);...
6
by: =?Utf-8?B?U2NvdHQgVHJpY2s=?= | last post by:
I followed the instructions from MSDN for Webclient UploadFile and I get an error: Could not find file 'C:\testfile.xls'. If I add the file (c:\testfile.xls) to the server I do not get the error...
5
by: benmess | last post by:
This code snippet works fine on a localhost because the file you upload resides on the host machine (where FileServer.aspx is a new page invoked from the UploadFile call) function...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.