applicious_utils 0.1.76 → 0.1.77
Sign up to get free protection for your applications and to get access to all the features.
@@ -43,6 +43,12 @@ module AppliciousUtils
|
|
43
43
|
out = ""
|
44
44
|
|
45
45
|
out << javascript_tag("$(function() {
|
46
|
+
|
47
|
+
function appliciousGetFileExtension(filename)
|
48
|
+
{
|
49
|
+
var ext = /^.+\.([^.]+)$/.exec(filename);
|
50
|
+
return ext == null ? "" : ext[1];
|
51
|
+
}
|
46
52
|
|
47
53
|
/*
|
48
54
|
* S3 Uploader instance
|
@@ -61,8 +67,8 @@ module AppliciousUtils
|
|
61
67
|
multi_selection: false,
|
62
68
|
multipart: true,
|
63
69
|
multipart_params: {
|
64
|
-
'key': 'uploads/#{filename_token}',
|
65
|
-
'Filename': 'uploads/#{filename_token}', // adding this to keep consistency across the runtimes
|
70
|
+
'key': 'uploads/#{filename_token}' + appliciousGetFileExtension( ${filename} ),
|
71
|
+
'Filename': 'uploads/#{filename_token}' + appliciousGetFileExtension( ${filename} ), // adding this to keep consistency across the runtimes
|
66
72
|
'acl': '#{options[:acl]}',
|
67
73
|
'Content-Type': '#{options[:content_type]}',
|
68
74
|
'success_action_status': '201',
|