travel-planner-backend/utils/upload/upload_sitephoto_to_s3.py
def upload_file_to_s3(complete_file_path, filename):
    """
    Uploads a file to AWS S3. Usage:
    upload_file_to_s3('/tmp/business_plan.pdf')
    """
    if complete_file_path is None:
        raise ValueError("Please enter a valid and complete file path")

    s3 = boto3.resource('s3')
    data = open(os.path.normpath(complete_file_path), 'rb')
    # file_basename = os.path.basename(complete_file_path)
    s3.Bucket(AWS_S3_BUCKET_NAME).put_object(Key=filename, Body=data)

    Uploads a file to AWS S3. Usage:
    upload_file_to_s3('/tmp/business_plan.pdf')
    
Uploads a file to AWS S3.
Uploads a file to AWS S3 .
def upload_file_to_s3(complete_file_path, filename):
    if complete_file_path is None:
        raise ValueError("Please enter a valid and complete file path")
    s3 = boto3.resource('s3')
    data = open(os.path.normpath(complete_file_path), 'rb')
    s3.Bucket(AWS_S3_BUCKET_NAME).put_object(Key=filename, Body=data)
def upload_file_to_s3 ( complete_file_path , filename ) : if complete_file_path is None : raise ValueError ( "Please enter a valid and complete file path" ) s3 = boto3 . resource ( 's3' ) data = open ( os . path . normpath ( complete_file_path ) , 'rb' ) s3 . Bucket ( AWS_S3_BUCKET_NAME ) . put_object ( Key = filename , Body = data )
Uploads a file to AWS S3.
Uploads a file to AWS S3 .
"""
    Uploads a file to AWS S3. Usage:
    upload_file_to_s3('/tmp/business_plan.pdf')
    """ # file_basename = os.path.basename(complete_file_path)
complete_file_path
filename