[Interest] QNetworkAccessManager put uploads contents twice

ashish dabhade ashishd157 at gmail.com
Tue Dec 1 07:00:32 CET 2015


To avoid that I also tested it by removing the authenticationRequired and
passing username and password in the url as per basic auth specs. For eg.
QUrl( "http://user:password@192.168.1.157/webdav/Media/somefile.mp4" ).
This too resulted the same behavior.
Also suppose the file is of large size say for eg. 300 Mb. wouldn't it be
unnecessary to upload so much data twice ?

I tested the same scenario with the now deprecated **QHttp** class and to
the surprise it uploaded the contents just once.

So if the above scenario is due to the design what would be the best way to
handle it ? For smaller files it is fine. I wanted to show the progress bar
for uploading which now fills up twice :)

On Mon, Nov 30, 2015 at 10:35 PM, Thiago Macieira <thiago.macieira at intel.com
> wrote:

> On Monday 30 November 2015 16:40:14 ashish dabhade wrote:
> > I'm trying to upload a file to Webdav using QNetworkAccessManager's
> **put**
> > method. But to the surprise it seems the file contents are uploaded
> > twice!!. Is this is known problem ? The Webdav is configured to allow
> Basic
> > Authentication
>
> It's not a problem. It's normal behaviour because we upload the entire file
> before we get the 401 error code, requesting authorisation. So the file
> needs
> to be uploaded again, after we emitted the authenticationRequired signal
> and
> got the credentials.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151201/a99c328b/attachment.html>


More information about the Interest mailing list