I am using django-uploadify-s3. It worked fine until I set:
'fileExt': r'*.sql'
in the uploadify_options file.
My problem (I think) is the condition field. I think that I also need to exclude the file extension in the field of my conditions. But I can’t figure out how to do this. At the moment, with the image below, I am getting 403 error.
The view in which the upload form is shown is as follows:
@login_required def upload_dump(req): options = {'onComplete': 'uploadifyOnComplete', 'onError': 'uploadifyOnError', 'fileDesc': r'PostgreSQL dump files (*.sql)', 'fileExt': r'*.sql', 'buttonText': r'Select SQL dump', } key_pattern = 'tc-%s/${filename}' % req.user.username post_data={'key': key_pattern, 'success_action_status': "201"} conditions={'key': {'op': 'starts-with', 'value': 'tc-%s/' % req.user.username}, 'fileExt': {'op': 'starts-with', 'value': r'sql'}, } uploadify_options = uploadify_s3.UploadifyS3(uploadify_options=options, post_data=post_data, conditions=conditions).get_options_json() return direct_to_template(req, 'users/upload_dump.html', 'uploadify_options':uploadify_options}
source share