Upload ZIP file to an HTTPS website (Secure File Transport) using .NET

Discussion in 'ASP .Net' started by tom, Nov 17, 2006.

  1. tom

    tom Guest

    What I want to do is upload a zip file to an https website. The site
    itself uses secure File transport. Now webclient has the simplicity to
    upload a file, but I cannot attach the neccessary cert to connect. If
    I use httpwebrequest I can successfully attach the cert but then what?
    Any ideas how to send this zip file over?

    Here is the code I started to play with....

    Dim wfClient As WebClient = New WebClient()
    Dim uri As String = "https://sft.site.com/"
    Dim fname As String = "c:\test.zip"
    Dim fcert As String = "C:\cert.P12"
    wfClient.UploadFile(uri, fname) 'When I run this I cant get past the
    security (cert) stuff

    'This successfully attaches a cert to a httpwebrequest but I don't know
    how to send the file?
    Dim myReq As HttpWebRequest = WebRequest.Create(uri)
    myReq.Method = "POST"
    myReq.ClientCertificates.Add(New
    System.Security.Cryptography.X509Certificates.X509Certificate
    (fcert, "certPassPhrase"))
     
    tom, Nov 17, 2006
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris  Becker

    Using scons zip builder to create zip

    Chris Becker, Oct 18, 2005, in forum: Python
    Replies:
    0
    Views:
    758
    Chris Becker
    Oct 18, 2005
  2. abcd
    Replies:
    7
    Views:
    780
    Edward Elliott
    May 1, 2006
  3. majj81
    Replies:
    0
    Views:
    491
    majj81
    May 31, 2006
  4. david wolf
    Replies:
    6
    Views:
    728
    Babu Kalakrishnan
    Sep 25, 2006
  5. Mufasa
    Replies:
    0
    Views:
    917
    Mufasa
    Jun 10, 2007
  6. Raven
    Replies:
    0
    Views:
    1,066
    Raven
    Nov 7, 2008
  7. Graham Wood
    Replies:
    3
    Views:
    951
    A. Sinan Unur
    Jan 11, 2004
  8. josh
    Replies:
    1
    Views:
    507
    Ben Morrow
    Jun 11, 2004
Loading...