Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 13th, 2012  |  syntax: None  |  size: 2.02 KB  |  hits: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Recieving HTTP ERROR with Django Uploadify S3
  2. @render
  3. def upload_example(request, object_id):
  4.  
  5.     options = {"onError":"function (a,b,c,d) {alert('Error: '+d.type+'      Info: '+d.info)} "}
  6.     key_pattern = 'example-%s/${filename}' % object_id
  7.     post_data={
  8.         'key': key_pattern,
  9.         'success_action_status': "201",
  10.         "starts-with": object_id
  11.         }
  12.  
  13.     #
  14.     # S3 uses conditions to validate the upload data. DUS3 automatically constructs
  15.     # and includes conditions for most of the elements that will be sent to S3, but you
  16.     # need to pass in conditions for:
  17.     #   - 'key', whose value changes at upload time. Note that the condition's value
  18.     #     must correspond to the key pattern set above.
  19.     #   - any extra elements set at upload time
  20.     #
  21.     # See the DUS3 README for more information on the conditions mapping:
  22.     #   https://github.com/sbc/django-uploadify-s3
  23.     #
  24.  
  25.     conditions={
  26.         'key': {    'op': 'starts-with',
  27.                     'value': ["$Filename", "$folder", "$key", "$Filedata", "$starts-with", "$Upload"], }
  28.         }
  29.  
  30.     uploadify_options = uploadify_s3.UploadifyS3(
  31.                             uploadify_options = options,
  32.                             post_data=post_data,
  33.                             conditions=conditions
  34.                             ).get_options_json()
  35.  
  36.     return ['s3.html', {"opt": uploadify_options}]
  37.        
  38. 7654158c29cb89182a7a8836253c91d61945e514e4a738ee1f502eda245f71e0 joshhunttest [08/Jun/2011:05:24:34 +0000] 137.166.55.199 - 8212E79B67E4469F REST.GET.OBJECT crossdomain.xml "GET /crossdomain.xml HTTP/1.1" 200 - 215 215 199 198 "http://localhost:8000/static/uploadify/uploadify.swf" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.10 Safari/535.1" -
  39.  
  40. 7654158c29cb89182a7a8836253c91d61945e514e4a738ee1f502eda245f71e0 joshhunttest [08/Jun/2011:05:24:35 +0000] 137.166.55.199 - FDA8CED6EF7C3A19 REST.POST.BUCKET  "POST / HTTP/1.1" 400 MaxPostPreDataLengthExceeded 360 - 1010 - "-" "Adobe Flash Player 10" -