1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-13 22:12:50 +02:00

Api: Fixes #843: Fixed regression that was preventing resource metadata from being downloaded

This commit is contained in:
Laurent Cozic
2018-10-04 08:17:53 +01:00
parent 99493174ec
commit 6b10d5d821
3 changed files with 18 additions and 16 deletions

View File

@@ -26,10 +26,10 @@ Linux | <a href='https://github.com/laurent22/joplin/releases/download/
The [portable application](https://en.wikipedia.org/wiki/Portable_application) allows installing the software on a portable device such as a USB key. Simply copy the file JoplinPortable.exe in any directory on that USB key ; the application will then create a directory called "JoplinProfile" next to the executable file. The [portable application](https://en.wikipedia.org/wiki/Portable_application) allows installing the software on a portable device such as a USB key. Simply copy the file JoplinPortable.exe in any directory on that USB key ; the application will then create a directory called "JoplinProfile" next to the executable file.
### Install and Update Ubuntu/Debian (Gnome Shell) On Linux, if it works with your distribution (it has been tested on Ubuntu, Fedora, Gnome and Mint), the recommended way is to use this script as it will handle the desktop icon too:
``` sh ``` sh
wget -O - https://raw.githubusercontent.com/laurent22/joplin/master/install_ubuntu.sh | bash wget -O - https://raw.githubusercontent.com/laurent22/joplin/master/Joplin_install_and_update.sh | bash
``` ```
## Mobile applications ## Mobile applications

View File

@@ -265,20 +265,22 @@ class Api {
// size: 164394 // size: 164394
if (request.method === 'GET') { if (request.method === 'GET') {
if (link !== 'file') throw new ErrorNotFound(); if (link === 'file') {
const resource = await Resource.load(id);
if (!resource) throw new ErrorNotFound();
const resource = await Resource.load(id); const filePath = Resource.fullPath(resource);
if (!resource) throw new ErrorNotFound(); const buffer = await shim.fsDriver().readFile(filePath, 'Buffer');
const response = new ApiResponse();
response.type = 'attachment';
response.body = buffer;
response.contentType = resource.mime;
response.attachmentFilename = Resource.friendlyFilename(resource);
return response;
}
const filePath = Resource.fullPath(resource); if (link) throw new ErrorNotFound();
const buffer = await shim.fsDriver().readFile(filePath, 'Buffer');
const response = new ApiResponse();
response.type = 'attachment';
response.body = buffer;
response.contentType = resource.mime;
response.attachmentFilename = Resource.friendlyFilename(resource);
return response;
} }
if (request.method === 'POST') { if (request.method === 'POST') {

View File

@@ -287,8 +287,8 @@
</tbody> </tbody>
</table> </table>
<p>The <a href="https://en.wikipedia.org/wiki/Portable_application">portable application</a> allows installing the software on a portable device such as a USB key. Simply copy the file JoplinPortable.exe in any directory on that USB key ; the application will then create a directory called &quot;JoplinProfile&quot; next to the executable file.</p> <p>The <a href="https://en.wikipedia.org/wiki/Portable_application">portable application</a> allows installing the software on a portable device such as a USB key. Simply copy the file JoplinPortable.exe in any directory on that USB key ; the application will then create a directory called &quot;JoplinProfile&quot; next to the executable file.</p>
<h3 id="install-and-update-ubuntu-debian-gnome-shell-">Install and Update Ubuntu/Debian (Gnome Shell)</h3> <p>On Linux, if it works with your distribution (it has been tested on Ubuntu, Fedora, Gnome and Mint), the recommended way is to use this script as it will handle the desktop icon too:</p>
<pre><code class="lang-sh">wget -O - https://raw.githubusercontent.com/laurent22/joplin/master/install_ubuntu.sh | bash <pre><code class="lang-sh">wget -O - https://raw.githubusercontent.com/laurent22/joplin/master/Joplin_install_and_update.sh | bash
</code></pre> </code></pre>
<h2 id="mobile-applications">Mobile applications</h2> <h2 id="mobile-applications">Mobile applications</h2>
<table> <table>