Re: [seafile] Upload api : Error 400

421 views
Skip to first unread message
Message has been deleted

Shuai Lin

unread,
Jan 30, 2015, 8:27:47 AM1/30/15
to sea...@googlegroups.com
What query params do you use in the file upload post request? Take a looke at http://manual.seafile.com/develop/web_api.html#upload-file-1

On Fri, Jan 30, 2015 at 8:58 PM, Sébastien Girard <girar...@gmail.com> wrote:

Hello,

I am working with the seafile API. I want to upload a file trough the API. First, I generate an upload link. But, when I want to POST data to this URL, everytime, I have 400 bad request

I have test with the url in the manual : curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" https://cloud.seafile.com/api2/repos/99b758e6-91ab-4265-b705-925367374cf0/upload-link/

I have change the value for my server, but error 400. Should I make a configuration in Seafile server or something ? The port 8082 is correctly responding in the internet.

Can you help me ?
Thanks

--
You received this message because you are subscribed to the Google Groups "seafile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seafile+u...@googlegroups.com.
To post to this group, send email to sea...@googlegroups.com.
Visit this group at http://groups.google.com/group/seafile.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Sebastian L

unread,
Feb 7, 2015, 9:29:48 AM2/7/15
to sea...@googlegroups.com
Hello Sébastien,

How did you solve the curl question? Could you post your command? What about your Bad Request in c#? Is it solved, too?
Thanks.


Am Samstag, 31. Januar 2015 19:47:42 UTC+1 schrieb Sébastien Girard:
Hello,

Thanks for your answer. The CURL is now OK. I have made an application in C# for testing the upload. I can give you the POST request made by my application. Can you look on this http://pastebin.com/8cmMfkwY (The file is truncated because it's too big) ? I have now a 400 error.

Did I miss a param ?

Thanks
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Sebastien Girard

unread,
Feb 8, 2015, 9:09:05 PM2/8/15
to sea...@googlegroups.com

Param file : The file content

Param filename : filename for the new file

 

 

De : sea...@googlegroups.com [mailto:sea...@googlegroups.com] De la part de Sebastian L
Envoyé : samedi, 7 février 2015 17:26
À : sea...@googlegroups.com
Objet : Re: [seafile] Upload api : Error 400

 

I meant the correct url. What was the solution of your problem? I am trying to send a curl with git bash on windows and first I had the same problem as you. Now I'm sending my curl and I don't get any response. Even in Seafile, I cannot see a new file.
Here's my url, maybe you could give me a hint what's wrong?

$ curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -F file=@c:\1.txt -F filename=1.txt -F parent_dir=/ http://192.168.1.111:8082/upload-api/8d4a4703-6368-424b-acf3-0b009b5c4018

I don't understand the parameters.
Is file= really the local file path? And is filename= the name for the new file in Seafile? What does parent_dir= mean?
I would appreciate if you could help me.

Thank you.



Am Samstag, 7. Februar 2015 16:28:30 UTC+1 schrieb Sébastien Girard:

Hello,

 

Yes, everything is working now. Curl is working fine too on linux.

 

Bad request is solved. I POST to the wrong url

--
You received this message because you are subscribed to a topic in the Google Groups "seafile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/seafile/I89X0mqNbU4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to seafile+u...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages