Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

permissions for download #11

Open
aschroder opened this issue Jun 6, 2012 · 1 comment
Open

permissions for download #11

aschroder opened this issue Jun 6, 2012 · 1 comment

Comments

@aschroder
Copy link
Contributor

The downloaded file should be stored in the configured backup folder, but seeing as it's only fetched temporarily I put it in the root of the directory running the script send it back to the client then delete it. But your permissions probably don't allow that. Short term fix would be relax permissions, or proper fix is below.

The fix is in:

public function downloadAction() {

on or about line 183 of BackupController.php

Add
$backupLocation = Mage::helper('cloudbackup')->getBackupLocation();
and then prefix the key with that location.

@aschroder
Copy link
Contributor Author

More info for people affected by this before it's fixed.

This call to the S3 client gets the file:

//fetch the file
$s3->getObject($bucket_name, $key_name, $key_name);

the 3rd parameter is the 'where to save it' one - it should be:

$file_to_save = $backupLocation."/".$key_name;
$s3->getObject($bucket_name, $key_name, $file_to_save);

and the same further down when it is streamed to the browser:
header('Content-length: '. filesize($file_to_save));
readfile($file_to_save);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant