Results 1 to 5 of 5

Thread: download password protected zip file from website

  1. #1
    Join Date
    Apr 2012
    Location
    India.
    Posts
    88
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default download password protected zip file from website

    Dear All,
    I would like to download zip file from website which is password protected.
    I am using QNetworkAccessManager and using which I can successfully download text file but no luck for zip file.

    Note that to open this zip file password is required.

    I am using Qt 5.3 on windows.

    Thanks,

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,309
    Thanks
    314
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: download password protected zip file from website

    There is no difference between downloading a text file and downloading a zip file, except that one is ASCII and one is binary. Reading a passworded zip file has nothing to do with QNetworkAccessManager. Its encryption and authentication methods apply to the connection, not to what is retrieved during a transaction.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Apr 2012
    Location
    India.
    Posts
    88
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: download password protected zip file from website

    I read documentation but couldn't find out what should be encryption and authentication settings here to read zip file.
    Please help, if someone has any idea.

    Thanks,

  4. #4
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: download password protected zip file from website

    Quote Originally Posted by Rajesh.Rathod View Post
    I read documentation but couldn't find out what should be encryption and authentication settings here to read zip file.
    Please help, if someone has any idea.
    More than likely, the code you're using to write out those contents is where you have the problem. Please show your code where you read the bytes from the reply and write them to a file.
    I write the best type of code possible, code that I want to write, not code that someone tells me to write!

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,309
    Thanks
    314
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: download password protected zip file from website

    I read documentation but couldn't find out what should be encryption and authentication settings here to read zip file.
    As I said (and jefftee also said), the QNetworkAccessManager authentication applies to accessing the file on the web site, not reading the file after it is downloaded. You are confusing encryption of the file with encryption (eg. password-restricted access) to the site. You can get to the site, that's not the issue.

    And as I also said, text files are ASCII, ZIP files are binary. If you are using a protocol that transfers the ZIP file as if it were ASCII, then you are not getting a binary file on your local disk, you are getting an ASCII file. Look at the protocol you are using to both read the file from the server and write it to the disk. If one or the other (or both) is assuming the file is ASCII, then your protocol is wrong.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. How to secure a file by password
    By miraks in forum Qt Programming
    Replies: 8
    Last Post: 22nd March 2011, 19:34
  2. Question about download in this website for Qt
    By l241002209l in forum General Discussion
    Replies: 4
    Last Post: 3rd August 2010, 17:23
  3. Download Page Source of Website
    By AjRomano in forum Newbie
    Replies: 3
    Last Post: 11th March 2010, 06:22
  4. About Password Protected Files:
    By vermarajeev in forum Qt Programming
    Replies: 7
    Last Post: 16th February 2007, 14:46
  5. QHttp GET File & Password
    By patrik08 in forum Qt Programming
    Replies: 4
    Last Post: 11th June 2006, 13:04

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.