Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7189004
uploaded-files.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
614 B
Referenced Files
None
Subscribers
None
uploaded-files.ts
View Options
import
Router
from
"@koa/router"
;
const
uploaded_files
=
new
Router
();
uploaded_files
.
get
(
"/:bucket/:filename"
,
async
(
ctx
)
=>
{
const
file
=
await
ctx
.
$app
.
FileManager
.
fromToken
(
ctx
.
$app
.
FileManager
.
encodeToken
(
ctx
.
params
.
bucket
==
"persistent"
,
ctx
.
params
.
filename
,
ctx
.
params
.
filename
)
);
ctx
.
body
=
file
.
getStream
();
// removing this as it only created trouble and you can declare download
// target in html <a> element, anyway
// ctx.set(
// "Content-Disposition",
// `attachment; filename*=utf-8''="${encodeURIComponent(file.filename)}"`
// );
});
export
default
uploaded_files
;
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Jul 8, 08:41 (1 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
810500
Default Alt Text
uploaded-files.ts (614 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment