C
Coder.com•5mo ago
DevPanda

File upload over API

Hey, I found you through Prisma while searching for a solution for isolated VS Code server instances. However, I need some additional features. Specifically, I need an API that allows me to upload and download files from individual instances. Is that possible with Coder?
15 Replies
Codercord
Codercord•5mo ago
Codercord
Codercord•5mo ago
<#1371462706430742628>
Category
Help needed
Product
code-server
Platform
Linux
Logs
Please post any relevant logs/error messages.
Phorcys
Phorcys•5mo ago
this isn't something our API supports OOTB, you'll have to hack something together, either with SFTP via Coder's ssh proxy or you could expose an API that lets you upload/download files as an HTTP app via a coder_app or port-forwarding you can probably work something out with our File Browser module but I'm not sure whether it's got an API so your best bet is probably to expose some custom http app that handles uploading/downloading by the way, are you talking about Prisma, as in the ORM? or something else?
DevPanda
DevPandaOP•5mo ago
yes from Prisma ORM 🙂 Okay, then I’ll need to build my own for that. 😦 There are so many VS Code server solutions, but none of them have support for VS Code extensions and has a file API.
Phorcys
Phorcys•5mo ago
yeah the file API abstraction is a bit too high level for the agent though, if you need to grab the same file, you could also just define its contents as a coder_metadata block, that will then be accessible through the API
DevPanda
DevPandaOP•5mo ago
i need to load file from DB in to the Code Editor, then he can edit it and when he is finish i can get the file and safe it to the database I tried to build my own using the Monaco Editor and the Prisma Language Server, but I wasn’t successful.
Phorcys
Phorcys•5mo ago
is it an SQLite DB? also, do you need it to be accessible via an API or do you just want to be able to access it locally?
DevPanda
DevPandaOP•5mo ago
no Postgres
Phorcys
Phorcys•5mo ago
we're building Coder Desktop (currently in Early Access), which allows you to mount a workspace's files locally, so that could help
Coder Desktop | Coder Docs
Use Coder Desktop to access your workspace like it's a local machine
Phorcys
Phorcys•5mo ago
ah then if it's postgres then do you need the files? you could either coder port-forward the PostgreSQL instance's port to your local machine, or have them send a SQL dump via an API or something
DevPanda
DevPandaOP•5mo ago
May I send you a DM? I don’t want to talk about my project publicly.
Phorcys
Phorcys•5mo ago
as in, having them push/pull from within the workspace itself instead of pulling/pushing from the outside of the workspace sure!
DevPanda
DevPandaOP•5mo ago
ty, done 🙂
Phorcys
Phorcys•5mo ago
(moved over to DMs)
Codercord
Codercord•5mo ago
@Phorcys closed the thread.

Did you find this page helpful?