Skip to content
Sign upLog in
← Back to Community

How to give download url to a file

Profile icon
ConvertAPI

Our script generated the file and it is saved in Files panel. We want to output message in the console and give download option to user to check the generated file. How to output downloadable file URL in the console.

Voters
Profile icon
MaryannWambui
Profile icon
Monkaie
Profile icon
ConvertAPI
Comments
hotnewtop
Profile icon
TheForArkLD

uhhhh you want give file to user?

Profile icon
ConvertAPI

@TheForArkLD
Yes, we want to give url to generated PDF file.

Profile icon
TheForArkLD

@ConvertAPI
ok

Profile icon
TheForArkLD

@ConvertAPI
wait i make api for upload file

Profile icon
ArnavBansal

One way to let users download a file is to set up a simple web server. In NodeJS, you can use a library such as express (expressjs.com) to do so

Profile icon
ConvertAPI

@ArnavBansal
Is here no build in repl.it option to give URL to Files in repl? Your suggestion is overcomplicated.

Profile icon
ArnavBansal

@ConvertAPI
well, you could just link to the repl itself?

Profile icon
ConvertAPI

@ArnavBansal
How to output that in console? I want to put download URL into console.log("The images has been merged to merge.pdf file.") I have tried to do that like this ./merge.pdf but the file in console is not clickable. Just run demo and you will find that there is no way to provide download url to just created file.

Profile icon
ArnavBansal

@ConvertAPI
you can print a full URL to the repl. console.log('https://repl.it/@ConvertAPI/Chaining-JPG-to-PDF-then-MERGE') should be clickable.

We're also working on a way to deeplink to files in the repl (but it won't open it as a PDF, just a PDF inside the repl)

Profile icon
ConvertAPI

@ArnavBansal
I want to give download url to file not repl.

Profile icon
ArnavBansal

@ConvertAPI
https://repl.it/@ArnavBansal/Chaining-JPG-to-PDF-then-MERGE A download url requires there to be a server at the other end. I don't think there's a simple access URL to grab a single file. A server in nodejs is pretty simple to set up ^

Profile icon
ConvertAPI

@ArnavBansal
I can easily click download on the left in Files repository and can't understand why I can't add a reference to that file into the console and you suggesting to set up a file server. No makes sense.

Profile icon
NoelB33

You just can’t... of my knowledge. There’s really no way to explain it but you just can’t.

@ConvertAPI