sqlitebrowser / dbhub.io

A "Cloud" for SQLite databases. Collaborative development for your data. 😊
https://dbhub.io
GNU Affero General Public License v3.0
372 stars 39 forks source link

Unable to upload a file using api with Invoke-WebRequest #215

Closed baptistend closed 1 year ago

baptistend commented 1 year ago

Hi !

I'm trying to upload a file using the api following the doc and I'm having some trouble. From what I understand, we need to pass a file as base64, so I did this :

 $form= @{
  >> "apikey"=$apikey
  >> "dbname"="test.db"
  >> "file"=$base64EncodedContent
  >> }
$uri = "https://api.dbhub.io/v1/upload"
$Result = Invoke-WebRequest -Uri $uri -Method Post -Form $form

But I got :

Invoke-WebRequest: { "error": "Something went wrong when grabbing the file data: 'http: no such file'" }

I also tried with a remote url instead of base64 file but I got the same error. I feel like I'm reaching a dead end here, any help would be appreciate !

NB:I'm sure my apikey and my base64EncodedContent are ok

justinclift commented 1 year ago

@baptistend Sorry for the delay, we somehow missed seeing several issues that have been filed on this repository. :frowning:

Do you still need help with this?

To me, it's not clear what software you're using for making the web request, and it's kind of sounding like that software is sending it in some way that our server doesn't understand.

But, that's an initial guess. We might need to do some debugging to figure out what's the deeper cause is (etc). :smile:

baptistend commented 1 year ago

Hi, no problem, I found another way to do this using firebase, but thank you for your response.

Have a good day!

justinclift commented 1 year ago

Cool. :smile: