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

howto upload a file using curl? #125

Open
mfa opened this issue Jan 13, 2015 · 7 comments
Open

howto upload a file using curl? #125

mfa opened this issue Jan 13, 2015 · 7 comments

Comments

@mfa
Copy link
Contributor

mfa commented Jan 13, 2015

no I don't want to use the cli-client.

I tried:
curl -F '[email protected];type=application/octet-stream' https://user:[email protected]/apis/rest/items -X POST

And get:

<html>
<head><title>413 Request Entity Too Large</title></head>
<body bgcolor="white">
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>

The documentation is no help because a curl example is missing.

@mfa mfa added the question label Jan 13, 2015
@NotANormalNerd
Copy link
Contributor

@NotANormalNerd
Copy link
Contributor

And since you want to upload the file in one chunk, you will have to have a look at this:
http://bepasty-server.readthedocs.org/en/latest/quickstart.html#bepasty.config.Config.MAX_BODY_SIZE

@mfa
Copy link
Contributor Author

mfa commented Jan 14, 2015

ok. the easiest way is to change the nginx configuration:
client_max_body_size 3G;

Now this works:

curl -F '[email protected];type=application/octet-stream' https://user:[email protected]/+upload -X POST

Answer:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="/Ywa79Uxx#filename.ext>/Ywa79Uxx#filename.ext</a>.  If not click the link.

everything fine now.

@mfa mfa closed this as completed Jan 14, 2015
@NotANormalNerd
Copy link
Contributor

You changed from rest-api to normal web?
Didn't it work with the rest api?

@mfa
Copy link
Contributor Author

mfa commented Jan 14, 2015

curl -F '[email protected];type=application/octet-stream' https://user:[email protected]/apis/rest/items -X POST

curl: (18) transfer closed with 27 bytes remaining to read

and /+list returns now Errorcode 500, because .data and .meta are 0 byte. #yay

@NotANormalNerd
Copy link
Contributor

I will rework the rest api to make is usable with curl and/or other similr tools

@makefu
Copy link
Contributor

makefu commented Aug 9, 2015

any updates on this one? The empty metadata issue seems to be a dupe of #126 .
with pull request #128 retrieval of all files, even if metadata are corrupted or unreadable.

maybe the api could be used for the web interface to avoid server error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants