View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001705 | FreeCAD | Bug | public | 2014-08-22 13:04 | 2015-01-04 22:39 |
Reporter | shoogen | Assigned To | wmayer | ||
Priority | low | Severity | tweak | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
OS | Linux | ||||
Product Version | 0.15 | ||||
Summary | 0001705: Download manager does not follow redirect (HTTP status 302) | ||||
Description | when Downloading a file from Dropbox a FCStd file is created showing only the original http response. 302 Found The resource was found at https://dl.dropboxusercontent.com/content_link/[redacted]; you should be redirected automatically. | ||||
Steps To Reproduce | use a dropbox download link with "?dl=1" | ||||
Tags | No tags attached. | ||||
FreeCAD Information | |||||
|
A concrete example is here: http://forum.freecadweb.org/viewtopic.php?f=8&t=9050&p=73623&hilit=dropbox#p73623 The link is https://www.dropbox.com/s/isyfghl3icpffn4/Weihnachtsbaum.FCStd?dl=0 The download link is https://www.dropbox.com/s/isyfghl3icpffn4/Weihnachtsbaum.FCStd?dl=1 I wonder how this works in general. The solution cannot be that we explicitly check for dropbox is host name and then replace the "dl=0" with "dl=1". When I click on this link from a browser then it will also first download the new HTML site which presents the actual download link, then. Any ideas? |
|
This is outside the scope of the ticket. The ticket is about not respecting the HTTP status codes. But i think that there is no suitable alternative to rewriting the urls. Not only for dropbox but for all major file hosting services (including google drive) Of cause we could open a html view, and let the user do a second click. We could as well punish people who don't add plain download links to their forum posts. |
|
So, as far as I understand your request now the user has to click the dropbox url in this post http://forum.freecadweb.org/viewtopic.php?f=8&t=9050&p=73623&hilit=dropbox#p73623 which then opens the dropbox site. This site offers a Download button with the url https://www.dropbox.com/s/isyfghl3icpffn4/Weihnachtsbaum.FCStd?dl=1 However, this still isn't the actual download link but https://dl.dropboxusercontent.com/content_link/PTu9FdaM5f7JNlYhJgzVGdgB7m3Bobs1BVrBQ6tRqbwZ1552DUJ8YXWG3TaqJ0pI?dl=1 |
|
> However, this still isn't the actual download link And as there is no obvious correlation to the "official" link, IMHO we have to handle the HTTP 302 (as well) But this won't solve the problem you mentioned above. (?dl=1) |
|
I have a solution: DownloadManager gets the method redirectUrl which explicitly replaces the url to dropbox to be '?dl=1' DownloadManager doesn't start the download immediately but handles the finished() signal of the network manager. In the connected slot it examines the url whether it's the original or a redirected one. But it still doesn't work to fetch files uploaded to Mantis. A url there e.g. looks like this: http://www.freecadweb.org/tracker/file_download.php?file_id=418&type=bug and when downloading it there is a text that access was denied. However, with a browser I can download files too without being logged in. Any ideas about this? |
|
when the type=bug is omitted i get the same result. |
|
When opening a report with webkit: import WebGui WebGui.openBrowser("http://www.freecadweb.org/tracker/view.php?id=972") then surprisingly the url (click or drag'n'drop) works while when dragging from a browser (tested with FF and Opera) it doesn't. I compared the string of the urls and found out that the failing urls ends with CR+LF. So, removing the CR+LF does the trick. |
FreeCAD: master c3102b69 2015-01-04 18:15:20 Details Diff |
+ issue 0001705: Download manager does not follow redirect (HTTP status 302) |
Affected Issues 0001705 |
|
mod - src/Gui/DownloadItem.cpp | Diff File | ||
mod - src/Gui/DownloadManager.cpp | Diff File | ||
mod - src/Gui/DownloadManager.h | Diff File | ||
mod - src/Gui/MainWindow.cpp | Diff File | ||
FreeCAD: master b2e32abe 2015-01-04 23:15:58 Details Diff |
+ fixes 0001705: Download manager does not follow redirect (HTTP status 302) |
Affected Issues 0001705 |
|
mod - src/Gui/DownloadManager.cpp | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-08-22 13:04 | shoogen | New Issue | |
2014-08-22 13:05 | shoogen | Summary | Download manager does follow HTTP status 302 => Download manager does not follow redirect (HTTP status 302) |
2015-01-04 13:05 | wmayer | Note Added: 0005502 | |
2015-01-04 14:25 | shoogen | Note Added: 0005504 | |
2015-01-04 14:25 | shoogen | Note Edited: 0005504 | |
2015-01-04 14:46 | wmayer | Note Added: 0005505 | |
2015-01-04 14:56 | shoogen | Note Added: 0005506 | |
2015-01-04 17:14 | wmayer | Note Added: 0005509 | |
2015-01-04 17:30 | wmayer | Changeset attached | => FreeCAD Master master c3102b69 |
2015-01-04 20:40 | shoogen | Note Added: 0005515 | |
2015-01-04 22:14 | wmayer | Note Added: 0005517 | |
2015-01-04 22:39 | wmayer | Changeset attached | => FreeCAD Master master b2e32abe |
2015-01-04 22:39 | wmayer | Assigned To | => wmayer |
2015-01-04 22:39 | wmayer | Status | new => closed |
2015-01-04 22:39 | wmayer | Resolution | open => fixed |