locked
Uploading files from VB.NET .exe to IIS via Internet RRS feed

  • Question

  • User-1607533591 posted
    Hi: I am working on an administration VB.NET .exe that uploads image files via the Internet to an IIS server directory as part of an adminstration function. I am unsure which method to use. I have tried webclient.uploadfile without success. Any suggestions as to the best method to use? TIA, Bill
    Wednesday, February 19, 2003 4:02 AM

All replies

  • User-2125802522 posted
    Try these two locations: http://www.dotnetjunkies.com/tutorials.aspx?tutorialid=127 http://www.aspheute.com/english/20000802.asp
    Friday, February 21, 2003 5:21 PM
  • User-1607533591 posted
    Jim: Thanks for your response, but neither of the links is appropriate as they are concerned with uploading from a browser to the server, I am using a windows form .exe to the server. I tried numerous combinations of webclient and eventually found the key was to filestream the image into a byte array and then use webclient.uploaddata with the "PUT" verb and not the "POST" verb. Also the aspnet client needs write rights on the directory on the server. Using webclient.upload file will default to the "POST" verb and raise 405 method not allowed errors. Cheers, Bill
    Sunday, February 23, 2003 12:00 PM
  • User1485426597 posted
    Bill, I tried your approach and I keep getting 403 error. Can you shed some light on how to assign the write rights. Thanks, Frank
    Sunday, March 16, 2003 11:18 PM
  • User-1607533591 posted
    Frank: Use Explorer/Properties/Security to add write permissions for the ASP_XXXX account or if you are impersonating that impersonating account- to the directory you choose to write to. Cheers, Bill
    Monday, March 17, 2003 8:52 AM
  • User1485426597 posted
    Bill, It works.... Mega Thanks Frank
    Thursday, April 3, 2003 2:16 PM
  • User-1908268993 posted
    Hello, I have a similar problem where I am trying to upload any file (txt, csv etc..) to any server in my network. my code is as follows String uriString = @"http://FileServer1/upload"; WebClient myWebClient = new WebClient(); string fileName = File1.PostedFile.FileName; byte[] responseArray = myWebClient.UploadFile(uriString,"POST",fileName); I am getting the following error. System.Net.WebException: The remote server returned an error: (405) Method Not Allowed. My aspx file is on another server and I am trying to upload the file to FileServer1. I have allowed full permission for ASPNET account to http://FileServer1/upload Still it does not work. Do you have any idea why?? Any help on this would be much appreciated. Thank You
    Tuesday, April 20, 2004 6:46 AM
  • User-1763866451 posted
    Hi NTV, I'm also facing the same problem like you. Did you have the answer about 405 Method Not Allowed exception? best regards
    Tuesday, May 18, 2004 12:40 AM
  • User-46888941 posted
    I guess you need to make an Web Service that uploads the file. Just send the file to the web service that uploads it on the server.
    Tuesday, May 18, 2004 12:44 PM
  • User77104320 posted

    hi bill,

    can you please elaborate your suggestion. iam bit new to .net. are you mentioning the security for the webfolder ? I have the write permissions enabled for the webfolder.but still im getting 403-forbidden error for PUT -verb.PLz help out in this settings part?

    Saturday, November 15, 2008 1:30 AM