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

how can I upload a file from windows platform #254

Closed
beepony opened this issue Sep 5, 2014 · 8 comments
Closed

how can I upload a file from windows platform #254

beepony opened this issue Sep 5, 2014 · 8 comments

Comments

@beepony
Copy link

beepony commented Sep 5, 2014

Hi,Thanks for your httpie,it helps me a lot. Now I have a question ,eg: I have a picture in C:\Users\beep\1.png,how can I upload a file from windows platform . I don't find the right command.

Thanks and sorry for my poor English

jkbrzt added a commit that referenced this issue Sep 5, 2014
It makes easier to work with Windows paths.

Closes #253, #254
@jkbrzt jkbrzt closed this as completed Sep 5, 2014
@jkbrzt
Copy link
Member

jkbrzt commented Sep 5, 2014

This is how:

$ http   example.org/path   @C:\Users\beep\1.png

You'll need to update to current master though, via:

$ pip install --upgrade https://github.com/jakubroztocil/httpie/tarball/master

@beepony
Copy link
Author

beepony commented Sep 8, 2014

Thanks a lot,I just try to do it ,and it seems does'nt work .the command like this:
http -a username:password v0.api.upyun.com/file-bin @C:\Users\beep\1.png
the error info like this:

所在位置 行:1 字符: 53
+ http -a opr10000:opr10000 v0.api.upyun.com/file-bin  <<<< @C:\Users\beep\1.png
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnrecognizedToken

the chinese means can not recognise the character in line 1

@jkbrzt
Copy link
Member

jkbrzt commented Sep 8, 2014

This is an error specific to your shell. I would guess that the @ has a special meaning for it. Try putting the path into quotes:

http -a username:password v0.api.upyun.com/file-bin '@C:\Users\beep\1.png'

@beepony
Copy link
Author

beepony commented Sep 8, 2014

Thanks a lot, I got 403 Access denied, and I checked my username and password, it's right . I was confused.
error

@jkbrzt
Copy link
Member

jkbrzt commented Sep 8, 2014

This looks like an unrelated auth issue. Make sure you have the right permissions.

(btw., I strongly advise you to change your password now as it's trivial to recover from the Authorization header that is included in the screenshot)

@beepony
Copy link
Author

beepony commented Sep 8, 2014

so kind of you, thanks again~ :)

@beepony
Copy link
Author

beepony commented Sep 10, 2014

Hi, I found the reason, file-bin is not a file, it's a bucket name.I should add an file in URI,

http -a username:password v0.api.upyun.com/file-bin/1.png '@c:\Users\beep\1.png'

@jkbrzt
Copy link
Member

jkbrzt commented Sep 10, 2014

Glad you have figured that out 👍

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

No branches or pull requests

2 participants