Skip to content
Snippets Groups Projects
Verified Commit 97f49d44 authored by Jonas Leder's avatar Jonas Leder
Browse files

proxy files instead of redirecting

parent 10741033
Branches
No related tags found
No related merge requests found
Pipeline #1510 passed
...@@ -24,4 +24,15 @@ $presignedRequest = $s3Client->createPresignedRequest($command, '60 minutes'); ...@@ -24,4 +24,15 @@ $presignedRequest = $s3Client->createPresignedRequest($command, '60 minutes');
// Get the actual presigned-url // Get the actual presigned-url
$downloadURL = (string) $presignedRequest->getUri(); $downloadURL = (string) $presignedRequest->getUri();
header("Location: $downloadURL");
\ No newline at end of file $curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $downloadURL);
curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($curl, CURLOPT_CONNECTTIMEOUT, 20);
curl_setopt ($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt ($curl, CURLOPT_FOLLOWLOCATION, true);
$content = curl_exec ($curl);
$contentType = curl_getinfo($curl, CURLINFO_CONTENT_TYPE);
header('Content-Type: ' . $contentType);
echo($content);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment