473,666 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vb.net webclient upload file and IIS configuration on XP

Not sure where to post this but simply I want to upload a file using the
WebClient, ie:

Try
Dim wc As New WebClient
wc.Credentials = New System.Net.Netw orkCredential(" someuser",
"somepass")
wc.UploadFile(" http://localhost/public/", "PUT", "c:\test.tx t")
Catch ex As Exception
Console.WriteLi ne(ex.Message)
Console.ReadKey ()
End Try

It always returns : The remote server returned an error: (403) Forbidden.

I have permissions set on public for read/write, I have web shared the
folder. Im guessing its how I have IIS setup. Using XP Pro sp3 and IIS.
Jul 14 '08 #1
2 6352
Not here.
dot net? we don't plat that. :)

"Mitch" <mh******@no.bo ther.to.spamwro te in message
news:D0Rek.233$ gH4.139@trnddc0 5...
Not sure where to post this but simply I want to upload a file using the
WebClient, ie:

Try
Dim wc As New WebClient
wc.Credentials = New System.Net.Netw orkCredential(" someuser",
"somepass")
wc.UploadFile(" http://localhost/public/", "PUT", "c:\test.tx t")
Catch ex As Exception
Console.WriteLi ne(ex.Message)
Console.ReadKey ()
End Try

It always returns : The remote server returned an error: (403) Forbidden.

I have permissions set on public for read/write, I have web shared the
folder. Im guessing its how I have IIS setup. Using XP Pro sp3 and IIS.

Jul 15 '08 #2
Mitch wrote:
Not sure where to post this but simply I want to upload a file using the
WebClient, ie:

Try
Dim wc As New WebClient
wc.Credentials = New System.Net.Netw orkCredential(" someuser",
"somepass")
wc.UploadFile(" http://localhost/public/", "PUT", "c:\test.tx t")
Catch ex As Exception
Console.WriteLi ne(ex.Message)
Console.ReadKey ()
End Try

It always returns : The remote server returned an error: (403) Forbidden.

I have permissions set on public for read/write, I have web shared the
folder. Im guessing its how I have IIS setup. Using XP Pro sp3 and IIS.

Yes, I think it is an IIS problem. Try giving the ASPNET user modify
permissions on the folder.
Jul 16 '08 #3

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

Similar topics

0
1165
by: Shen | last post by:
Hi, I have a windows app that uses vb.net WebClient upload function to upload a file to the website for processing. My website uses ASP. I know how to parse a uploaded file from a webpage using <input type=file...> inputfile control. But I just wondered how I can receive or parse a file from a winapp. Does anyone have some sample code for upload file? both in winapp and server side.
2
1432
by: Brian | last post by:
Hi, I've been trying to find a way to upload file to another site that is not using IIS. The site that I want to upload file to has a simple php script to receive file uploaded through standard http post with a file upload. However, how do I upload file to the site using asp.net? thanks Brian
1
1795
by: paras | last post by:
I am using File Upload Control to upload file on server. If size of the file exceeds maxRequestLength property in httpRuntime section of my configuration file, then DNS error is thrown. how can i restrict the user from selecting a file of specific size. Best solution would be if i can restrict the user on client side. If not possible, then how can i handle the DNS error on server? Any help would be greatly appreciated.
3
2423
by: Brian | last post by:
Hi, I've been trying to find a way to upload file to another site that is not using IIS. The site that I want to upload file to has a simple php script to receive file uploaded through standard http post with a file upload. However, how do I upload file to the site using asp.net? thanks Brian
1
5178
by: Pedro Carvalho | last post by:
I am using a WebClient.Upload File method on the Client side and, to accept posted files on the Server side, I am using an ASP.NET page with the following code: void Page_Load(object sender, EventArgs e) { foreach(string f in Request.Files.AllKeys) { HttpPostedFile file = Request.Files; file.SaveAs("c:\\WUTemp\\" + file.FileName);
0
1845
by: cherry | last post by:
Dear All, I have written a program in sharepoint, in which will call a Web Service of another Sharepoint portal server so that documents from sharepoint portal server A can push document to Sharepoint portal Server B whose domain is stood alone. However, the program is unable to upload file over 2MB, when the file size exceeds, timeout will occur! I have tried to make a change in the web.config and machine.config of sharepoint portal...
2
1296
by: aratimane | last post by:
I'm using php5.2.2 and not able to upload file from mobile J2ME . same code is running in php4.3.11 but not in php5.2.2 I'm uploading file by using $_FILES. while using print_r($_FILES) it display : name of file ,type of file but error=3 and size=0 same script is successfully worked in php4.3.11 with apache2.0.59 but not in php5.2.2
3
4293
by: =?Utf-8?B?dmFzaW1v?= | last post by:
Have the following code: wkLocalPath = "C:\A\1.jpg" wkServerPath = "http://servername/dirname/1.jpg" wcClient.Credentials = New NetworkCredential("UID", "PW") wcClient.UploadFile(wkServerPath, "PUT", wkLocalPath) File exists on C. Dir exist on server (ASPNET user and Admin user have full rights) (tried both) Created virtual for Dirname and gave it write access in properties) "POST" gives same results.
0
1376
by: rajib123 | last post by:
I am trying to write a windows utility that downloads some files from an ftp site to a local directory and then uploads those files to another ftp site. The files that I need to download are posted on the ftp site everyday. The file name contains the datetime stamp, so the filename changes everyday. Files are named as such: abc.com.ftc1.062210083741 I am using a ftpwebrequest method to get a listing of all the files on the ftp directory. Then...
0
8448
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8783
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8552
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7387
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2773
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.