We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It is possible to upload a file directly from the browser to the ObjectStore using FormPost. This is the code in the HTML:
<form action="https://0fef7424e0f44779abf6e98d0bae9874.objectstore.eu/installables" method="POST" enctype="multipart/form-data"> <input type="hidden" name="redirect" value="https://sis.42.nl/list" /> <input type="hidden" name="max_file_size" value="104857600" /> <input type="hidden" name="max_file_count" value="10" /> <input type="hidden" name="expires" value="1375255337" /> <input type="hidden" name="signature" value="c264da6ff7910a6a161e2da4b546c3aeee1a3d9a" /> <input type="file" name="file1" /><br /> <input type="submit" /> </form>
JOSS must be capable of generating the signature for FormPost on the basis of the following parameters:
I got it working in a test setup with this configuration:
path: /v1/AUTH_0fef7424e0f44779abf6e98d0bae9874/installables redirect: https://sis.42.nl/list max_file_size: 104857600 max_file_count: 10 expires: 1375255337 signature: c264da6ff7910a6a161e2da4b546c3aeee1a3d9a
This python code helps in determining the signature:
import hmac from hashlib import sha1 from time import time print '============' path = '/v1/AUTH_0fef7424e0f44779abf6e98d0bae9874/installables' print 'path: '+path redirect = 'https://sis.42.nl/list' print 'redirect: '+redirect max_file_size = 104857600 print 'max_file_size: '+str(max_file_size) max_file_count = 10 print 'max_file_count: '+str(max_file_count) expires = int(time() + 86400) print 'expires: '+str(expires) key = '********' hmac_body = '%s\n%s\n%s\n%s\n%s' % (path, redirect, max_file_size, max_file_count, expires) signature = hmac.new(key, hmac_body, sha1).hexdigest() print 'signature: '+signature
Note that the official documentation places a '/' at the end of path. This doesn't work.
The text was updated successfully, but these errors were encountered:
Issue #43 Added support for FormPost, so that files can be uploaded d…
b2daba2
…irectly from the browser
Issue javaswift#43 Added support for FormPost, so that files can be u…
731d916
…ploaded directly from the browser
robert-bor
No branches or pull requests
Introduction
It is possible to upload a file directly from the browser to the ObjectStore using FormPost. This is the code in the HTML:
Technical background
JOSS must be capable of generating the signature for FormPost on the basis of the following parameters:
I got it working in a test setup with this configuration:
This python code helps in determining the signature:
Note that the official documentation places a '/' at the end of path. This doesn't work.
Reading
The text was updated successfully, but these errors were encountered: