Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct Download Url Support #5707

Closed
502647092 opened this issue Jul 13, 2019 · 8 comments
Closed

Direct Download Url Support #5707

502647092 opened this issue Jul 13, 2019 · 8 comments
Labels
enhancement issues that are enhancements to current functionality - nice to haves filesystem issues related to the filesystem

Comments

@502647092
Copy link
Contributor

Description

@kittaakos @akosyakov
before #5466 i have a script to auto sync theia workspace and server use direct download url
but after #5466 i can't do it
maybe can provide a permanent link for some file or dir

Reproduction Steps

OS and Theia version:
Diagnostics:

@akosyakov akosyakov added question user / developer questions filesystem issues related to the filesystem labels Jul 13, 2019
@akosyakov
Copy link
Member

akosyakov commented Jul 13, 2019

cc @kittaakos @uniibu

@akosyakov akosyakov added enhancement issues that are enhancements to current functionality - nice to haves and removed question user / developer questions labels Jul 15, 2019
@akosyakov
Copy link
Member

maybe can provide a permanent link for some file or dir

There is 1m timeout before a link is gone. If you script connect within 1m after triggering download, it should not it be enough? Or you missing some additional APIs, i.e. to detect programmatically when download is prepared?

@502647092
Copy link
Contributor Author

@akosyakov before pr i can use workspace path direct download like /home/project/xxxx
but now i should use ui ti copy download link like xxxx/file/download?id=xxxxxx

@akosyakov
Copy link
Member

akosyakov commented Jul 15, 2019

We could provide a http-endpoint to get a link, so that you don't need UI. Would it work?

@502647092
Copy link
Contributor Author

@akosyakov ok

@kittaakos
Copy link
Contributor

so that you don't need UI

You do not need UI. you have to do two separate requests instead. First, you get the download ID with an HTTP GET. This can be a PUT if you want to download multiple files, then you perform another GET with the download ID.

curl -s http://localhost:3000/files/download?id=`node -pe 'JSON.parse(process.argv[1]).id' "$(curl -s curl http://localhost:3000/files/?uri=file:///Users/akos.kitta/git/theia/README.md)"` --output your-readme.txt

Note, here I have used Node.js to parse the download ID, but you are free to use whatever you want, for instance, jq.

@502647092, it would be great if you can adapt your scripts to the latest file download API, and get back to us if you could not use the proposed solution. If it works, I suggest closing this.

@502647092
Copy link
Contributor Author

@kittaakos Thank you
That's enough

@kittaakos
Copy link
Contributor

That's enough

I did not check for archives, feel free to reopen if you could not fully restore your scripts. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement issues that are enhancements to current functionality - nice to haves filesystem issues related to the filesystem
Projects
None yet
Development

No branches or pull requests

3 participants