In AWS S3, how to generate a file to download a file without expiration.
conn = boto.connect_s3(awsAccessKey, awsSecret) # Get bucket instance. bucket = conn.get_bucket(bktName) fileKey = bucket.get_key(fileKey) url = fileKey.generate_url(expires_in=None, query_auth=True, force_http=True) print url
How to generate file url without expiration?
According to the latest docs ( http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html ):
The assigned URL can be valid for no more than seven days, because the signature key that you use to calculate the signature is valid for up to seven days.
Since the signature itself can only be valid for seven days, it is not possible for the signed URL to be valid for more than seven days. The only way to have a permanent valid URL is to make the file public.
The validity period of a link is to allow limited access to private files without exposing authentication keys.
If you want to make the file always accessible, make the file public or grant permissions to other s3 users.
Source: https://habr.com/ru/post/1493162/More articles:Inside arrow on the right with border outline and boxshadow - cssAmpersand with parameters - ruby | fooobar.comHow to recompile the Google Drive API SDK? - visual-studioC # does not accept c1, c2, c3 as defined vars - scopeUnauthorized user in mysql process list - hacking attempt? - securityHow to make an image using multiple images using Carrierwave and MiniMagick - ruby | fooobar.comHow can I customize the ViewPager layoutParams programmatically? - javaHow to call a browser window or tab closing events using jQuery - jqueryr - add significance level to the correlation map - rEnum and anonymous enumeration in C ++ - c ++All Articles