Skip to content

'New -> From Link'-download fails with redirections/rewrites/forwardings #3614

Closed

Description

@renne

1.) If any URL is entered which redirects or forwards, the HTML-content of the redirection/forwarding is downloaded instead of the real file.

2.) The file name is created from the URL-parameters instead of the the content-header.

That two bugs make the link-download function quite useless.

Solution for PHPCurl:

1.) Use option CURLOPT_FOLLOWLOCATION => true to follow redirects

2.) Use option CURLOPT_HEADERFUNCTION => array($this, 'getHeader') to get the content-header with the function

private function getHeader($con, $header) {

    /* Parse header */

    // !!! Necessary for cURL to work !!!
    return mb_strlen($header);
}

http://gitorious.org/hltvdlm/hltvdlm/blobs/master/CURL.php provides an example for downloading files with PHPCurl.

Activity

  1. jancborchardt commented on Aug 16, 2013

    @jancborchardt
    Contributor

    I’m closing this issue because it has been inactive for a few months. This probably means that the issue is not reproducible or it has been fixed in a newer version.

    Please reopen if you still encounter this issue with the latest stable version (currently ownCloud 5.0.10) and then please use the issue template. You an also contribute directly by providing a patch – see the developer manual. :)

    Thank you!

  2. bantu commented on Jan 17, 2014

    @bantu

    Confirming both to be an issue. For 2) also see #1198

  3. reopened this on Jan 17, 2014
  4. ghost assigned on Jan 17, 2014
  5. bantu commented on Sep 21, 2014

    @bantu
  6. bantu commented on Sep 29, 2014

    @bantu

    @LukasReschke I think you fixed (1). For (2) we can use #1198. So this can be closed?

  7. LukasReschke commented on Sep 29, 2014

    @LukasReschke
    Contributor

    Yes

  8. locked as resolved and limited conversation to collaborators on Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions