1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-04-07 21:38:58 +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.
### 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
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

View File

@ -265,20 +265,22 @@ class Api {
// size: 164394
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);
if (!resource) throw new ErrorNotFound();
const filePath = Resource.fullPath(resource);
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);
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 (link) throw new ErrorNotFound();
}
if (request.method === 'POST') {

View File

@ -287,8 +287,8 @@
</tbody>
</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>
<h3 id="install-and-update-ubuntu-debian-gnome-shell-">Install and Update Ubuntu/Debian (Gnome Shell)</h3>
<pre><code class="lang-sh">wget -O - https://raw.githubusercontent.com/laurent22/joplin/master/install_ubuntu.sh | bash
<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/Joplin_install_and_update.sh | bash
</code></pre>
<h2 id="mobile-applications">Mobile applications</h2>
<table>