Skip to content

Commit c0176ee

Browse files
authored
Merge pull request #116 from protect-earth/al/115
Append .jpg file extension for upload
2 parents 81c0236 + c3d1c5d commit c0176ee

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Tree Tracker/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>0.11.4</string>
20+
<string>0.11.5</string>
2121
<key>CFBundleVersion</key>
2222
<string>$(CURRENT_PROJECT_VERSION)</string>
2323
<key>ITSAppUsesNonExemptEncryption</key>

Tree Tracker/Services/ProtectEarth/ProtectEarthTreeService.swift

+3-2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ class ProtectEarthTreeService: TreeService {
7272

7373
var latitude = "0"
7474
var longitude = "0"
75+
var uploadKey = "\(Secrets.awsBucketPrefix)/\(tree.treeId).jpg"
7576

7677
if (coordinates.count == 2) {
7778
latitude = coordinates[0]
@@ -98,15 +99,15 @@ class ProtectEarthTreeService: TreeService {
9899

99100
transferUtility.uploadData(data,
100101
bucket: Secrets.awsBucketName,
101-
key: "\(Secrets.awsBucketPrefix)/\(tree.treeId)",
102+
key: uploadKey,
102103
contentType: "image/jpeg",
103104
expression: expression,
104105
completionHandler: completionHolder.completionHandler
105106
)
106107
.continueWith { (task) -> AnyObject? in
107108
// stuff we want to do once the task is *STARTED*
108109
Rollbar.infoMessage("S3 upload started", data: [
109-
"bucket-path": "\(Secrets.awsBucketPrefix)/\(tree.treeId)",
110+
"bucket-path": uploadKey,
110111
"x-amz-meta-datetaken": tree.createDate?.ISO8601Format(),
111112
"x-amz-meta-supervisor": tree.supervisor,
112113
"x-amz-meta-latitude": latitude,

Unit Tests/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>0.11.4</string>
18+
<string>0.11.5</string>
1919
<key>CFBundleVersion</key>
2020
<string>1</string>
2121
</dict>

0 commit comments

Comments
 (0)