1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 15:38:15 +00:00

[shared file view] fixed download url for file from shared dir

This commit is contained in:
llj
2019-05-15 18:24:20 +08:00
parent aa5ad1f8b0
commit f187c101c8

View File

@@ -15,7 +15,7 @@ const propTypes = {
};
let loginUser = window.app.pageOptions.name;
const { repoID, sharedToken, trafficOverLimit, fileName, fileSize, sharedBy, siteName, enableWatermark, download, zipped } = window.shared.pageOptions;
const { repoID, sharedToken, trafficOverLimit, fileName, fileSize, sharedBy, siteName, enableWatermark, download, zipped, filePath } = window.shared.pageOptions;
class SharedFileView extends React.Component {
@@ -99,7 +99,7 @@ class SharedFileView extends React.Component {
</Button>
}{' '}
{!trafficOverLimit &&
<a href="?dl=1" className="btn btn-success">{gettext('Download')}({Utils.bytesToSize(fileSize)})</a>
<a href={`?${zipped ? 'p=' + encodeURIComponent(filePath) + '&' : ''}dl=1`} className="btn btn-success">{gettext('Download')}({Utils.bytesToSize(fileSize)})</a>
}
</div>
}