473,385 Members | 1,468 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,385 software developers and data experts.

upload a txt file on a remote web server

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

regards
shantanu
WebClient client = new WebClient();
client.Credentials = netCred;
client.Headers.Add("Content-Type","application/x-www-form-
urlencoded");
client.UploadFile("http://aww.ngn.bel.alcatel.be/prp/cgi-bin/secure/
ImportForm.cgi","POST",@"C:\PRP\PRPTemp.txt");

Jun 25 '07 #1
5 3650
Hello,

Checkout this link, it explains how to make it step by step

http://www.4guysfromrolla.com/webtech/091201-1.shtml

you can check as well:

http://www.c-sharpcorner.com/UploadF...7-a64a09b0ee6b

HTH
Braulio

/// ------------------------------
/// Braulio DÃ*ez
///
/// http://www.tipsdotnet.com
/// ------------------------------


"shantanu" wrote:
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

regards
shantanu
WebClient client = new WebClient();
client.Credentials = netCred;
client.Headers.Add("Content-Type","application/x-www-form-
urlencoded");
client.UploadFile("http://aww.ngn.bel.alcatel.be/prp/cgi-bin/secure/
ImportForm.cgi","POST",@"C:\PRP\PRPTemp.txt");

Jun 25 '07 #2
On Jun 25, 4:03 pm, Braulio Diez <braulio121NOS...@yahoo.eswrote:
Hello,

Checkout this link, it explains how to make it step by step

http://www.4guysfromrolla.com/webtech/091201-1.shtml

you can check as well:

http://www.c-sharpcorner.com/UploadF...ad100920051721...

HTH
Braulio

/// ------------------------------
/// Braulio Díez
///
///http://www.tipsdotnet.com
/// ------------------------------

"shantanu" wrote:
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
regards
shantanu
WebClient client = new WebClient();
client.Credentials = netCred;
client.Headers.Add("Content-Type","application/x-www-form-
urlencoded");
client.UploadFile("http://aww.ngn.bel.alcatel.be/prp/cgi-bin/secure/
ImportForm.cgi","POST",@"C:\PRP\PRPTemp.txt");- Hide quoted text -

- Show quoted text -
hi thanx for the reply
i just read the two links where the gui is present to upload the
files. But in my case i have a excel addin that will pick few values
from the excel sheet and form a text file that is compatible to the
upload format. Now i have a link of a web page that contains a file
control and a import button. on the click of the import button it
takes the file path as the parameter and invokes import.cgi script.
Now i have to upload a file thru this link using meathod like
webclient or any other meathod.
So i hope i have explained the things . Kindly get some solution
regards
shantanu

Jun 25 '07 #3
Mmm...

Correct me if I'm wrong, but the problem that you are facing is simulating
a manual file upload: a web app has an upload button and you want to simulate
that operation, is that assumption correct?

I'm not sure if it would be a good approach to take an sniffer and see
what http traces does the manual import generate, then you could simulate
that behaviour using HTTPRequests.

Not an easy scenario, the website could have even some upload component or
strange stuff :-(, here you have a code sample about file upload using
HTTPRequests:

http://www.example-code.com/csharp/httpUpload.asp

Good Luck
Braulio
/// ------------------------------
/// Braulio DÃ*ez
///
/// http://www.tipsdotnet.com
/// ------------------------------


"shantanu" wrote:
On Jun 25, 4:03 pm, Braulio Diez <braulio121NOS...@yahoo.eswrote:
Hello,

Checkout this link, it explains how to make it step by step

http://www.4guysfromrolla.com/webtech/091201-1.shtml

you can check as well:

http://www.c-sharpcorner.com/UploadF...ad100920051721...

HTH
Braulio

/// ------------------------------
/// Braulio Dmez
///
///http://www.tipsdotnet.com
/// ------------------------------

"shantanu" wrote:
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
regards
shantanu
WebClient client = new WebClient();
client.Credentials = netCred;
client.Headers.Add("Content-Type","application/x-www-form-
urlencoded");
client.UploadFile("http://aww.ngn.bel.alcatel.be/prp/cgi-bin/secure/
ImportForm.cgi","POST",@"C:\PRP\PRPTemp.txt");- Hide quoted text -
- Show quoted text -

hi thanx for the reply
i just read the two links where the gui is present to upload the
files. But in my case i have a excel addin that will pick few values
from the excel sheet and form a text file that is compatible to the
upload format. Now i have a link of a web page that contains a file
control and a import button. on the click of the import button it
takes the file path as the parameter and invokes import.cgi script.
Now i have to upload a file thru this link using meathod like
webclient or any other meathod.
So i hope i have explained the things . Kindly get some solution
regards
shantanu

Jun 26 '07 #4
On Jun 26, 11:16 am, Braulio Diez <braulio121NOS...@yahoo.eswrote:
Mmm...

Correct me if I'm wrong, but the problem that you are facing is simulating
a manual file upload: a web app has an upload button and you want to simulate
that operation, is that assumption correct?

I'm not sure if it would be a good approach to take an sniffer and see
what http traces does the manual import generate, then you could simulate
that behaviour using HTTPRequests.

Not an easy scenario, the website could have even some upload componentor
strange stuff :-(, here you have a code sample about file upload using
HTTPRequests:

http://www.example-code.com/csharp/httpUpload.asp

Good Luck
Braulio

/// ------------------------------
/// Braulio Díez
///
///http://www.tipsdotnet.com
/// ------------------------------

"shantanu" wrote:
On Jun 25, 4:03 pm, Braulio Diez <braulio121NOS...@yahoo.eswrote:
Hello,
Checkout this link, it explains how to make it step by step
>http://www.4guysfromrolla.com/webtech/091201-1.shtml
you can check as well:
>http://www.c-sharpcorner.com/UploadF...ad100920051721....
HTH
Braulio
/// ------------------------------
/// Braulio Dmez
///
///http://www.tipsdotnet.com
/// ------------------------------
"shantanu" wrote:
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
regards
shantanu
WebClient client = new WebClient();
client.Credentials = netCred;
client.Headers.Add("Content-Type","application/x-www-form-
urlencoded");
client.UploadFile("http://aww.ngn.bel.alcatel.be/prp/cgi-bin/secure/
ImportForm.cgi","POST",@"C:\PRP\PRPTemp.txt");- Hide quoted text -
- Show quoted text -
hi thanx for the reply
i just read the two links where the gui is present to upload the
files. But in my case i have a excel addin that will pick few values
from the excel sheet and form a text file that is compatible to the
upload format. Now i have a link of a web page that contains a file
control and a import button. on the click of the import button it
takes the file path as the parameter and invokes import.cgi script.
Now i have to upload a file thru this link using meathod like
webclient or any other meathod.
So i hope i have explained the things . Kindly get some solution
regards
shantanu- Hide quoted text -

- Show quoted text
Hi Thanx for the reply
i am trying this meathod today hope come up with a positive result
regards
shantanu

Jun 27 '07 #5
On Jun 27, 8:18 am, shantanu <shantanuse...@gmail.comwrote:
On Jun 26, 11:16 am, Braulio Diez <braulio121NOS...@yahoo.eswrote:


Mmm...
Correct me if I'm wrong, but the problem that you are facing is simulating
a manual file upload: a web app has an upload button and you want to simulate
that operation, is that assumption correct?
I'm not sure if it would be a good approach to take an sniffer and see
what http traces does the manual import generate, then you could simulate
that behaviour using HTTPRequests.
Not an easy scenario, the website could have even some upload component or
strange stuff :-(, here you have a code sample about file upload using
HTTPRequests:
http://www.example-code.com/csharp/httpUpload.asp
Good Luck
Braulio
/// ------------------------------
/// Braulio Díez
///
///http://www.tipsdotnet.com
/// ------------------------------
"shantanu" wrote:
On Jun 25, 4:03 pm, Braulio Diez <braulio121NOS...@yahoo.eswrote:
Hello,
Checkout this link, it explains how to make it step by step
http://www.4guysfromrolla.com/webtech/091201-1.shtml
you can check as well:
http://www.c-sharpcorner.com/UploadF...ad100920051721...
HTH
Braulio
/// ------------------------------
/// Braulio Dmez
///
///http://www.tipsdotnet.com
/// ------------------------------
"shantanu" wrote:
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
regards
>shantanu
WebClient client = new WebClient();
client.Credentials = netCred;
client.Headers.Add("Content-Type","application/x-www-form-
urlencoded");
client.UploadFile("http://aww.ngn.bel.alcatel.be/prp/cgi-bin/secure/
ImportForm.cgi","POST",@"C:\PRP\PRPTemp.txt");- Hide quoted text -
- Show quoted text -
hi thanx for the reply
i just read the two links where the gui is present to upload the
files. But in my case i have a excel addin that will pick few values
from the excel sheet and form a text file that is compatible to the
upload format. Now i have a link of a web page that contains a file
control and a import button. on the click of the import button it
takes the file path as the parameter and invokes import.cgi script.
Now i have to upload a file thru this link using meathod like
webclient or any other meathod.
So i hope i have explained the things . Kindly get some solution
regards
>shantanu- Hide quoted text -
- Show quoted text

Hi Thanx for the reply
i am trying this meathod today hope come up with a positive result
regardsshantanu- Hide quoted text -

- Show quoted text -
Hi
It did not work tooo
kindly assist
regards
shantanu

Jul 2 '07 #6

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

Similar topics

1
by: PeterB | last post by:
Hi! I'm using Pure ASP File Upload (http://www.asp101.com/articles/jacob/scriptupload.asp) to upload a file from a client to a server. I am testing both on a local IIS and a remote server. The...
4
by: R Reyes | last post by:
I am trying to code a file uploader (for forum/email attachments) from the client computer to a remote web server via the PUT method (since POST is not allowed ). However, the upload works ONLY...
6
by: Pat Carden | last post by:
Hi, We need to allow webusers to upload a file on our website (on Server3, all servers run Server 2003, remotely hosted) and eventually save it on our SBS Server (Server2) which is not exposed...
18
by: Jen | last post by:
I'm using Microsoft's own VB.NET FTP Example: http://support.microsoft.com/default.aspx?scid=kb;en-us;832679 I can get the program to create directories, change directories, etc., but I can't...
1
by: pmz | last post by:
Dear Group, I'm currently developing a simple Windows application in C#, which is supposed to upload images - through 'WebClient' - into remote (FreeBSD/Apache/PHP) server. What is...
7
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file"...
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
0
by: garimak | last post by:
Hi I m using the file uploader component for uploading the file on the remote server.It works fine when the server comes under my machines domain but when I try to upload a file on the server which...
1
by: lPrentice | last post by:
Hello, After all this time, Linux file permissions still confuse me at times. I have a Python web-based application with an file (images) upload module. The application is running on two remote...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.