Skip to main content

Package to upload object to aws s3 and return s3 file url

Project description

File upload to AWS S3

This packge can be used to upload file in s3 and get file generated url.

Steps to use package

  1. Install package with pip install fileUploadS3_x21182787
  2. import package in python and use it
>> from fileUploadS3_x21182787 import uploadGenrateUrl

>> uploadGenrateUrl.s3UploadGenURL("b64EncodedData","filename.ext","bucket_name")

Funcation Description

s3UploadGenURL(b64EncodedData, s3_file, bucket_name) will take 3 parameters

  1. b64EncodedData - Data should be in base64 encoded formate.
  2. s3_file - File name in which data to be stored eg. abc.jpg, file.doc etc...
  3. bucket_name - S3 bucket name file to be store.

Example

import json
from fileUploadS3_x21182787 import uploadGenerateUrl

response = uploadGenrateUrl.s3UploadGenURL("b64EncodedData","filename.ext","bucket_name")

print(json.loads(response)) # {"img_url": "s3_file_url"}

print(json.loads(response)[img_url]) # will print s3_file_url
Note:
Before using the response convert it to json `json.loads(response)`. because package returing stringified json.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fileuploads3_x21182787-0.0.1.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

fileuploads3_x21182787-0.0.1-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page