Skip to content

Commit

Permalink
Merge pull request #116 from protect-earth/al/115
Browse files Browse the repository at this point in the history
Append .jpg file extension for upload
  • Loading branch information
allanlang committed Dec 6, 2023
2 parents 81c0236 + c3d1c5d commit c0176ee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Tree Tracker/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>0.11.4</string>
<string>0.11.5</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>ITSAppUsesNonExemptEncryption</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class ProtectEarthTreeService: TreeService {

var latitude = "0"
var longitude = "0"
var uploadKey = "\(Secrets.awsBucketPrefix)/\(tree.treeId).jpg"

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

transferUtility.uploadData(data,
bucket: Secrets.awsBucketName,
key: "\(Secrets.awsBucketPrefix)/\(tree.treeId)",
key: uploadKey,
contentType: "image/jpeg",
expression: expression,
completionHandler: completionHolder.completionHandler
)
.continueWith { (task) -> AnyObject? in
// stuff we want to do once the task is *STARTED*
Rollbar.infoMessage("S3 upload started", data: [
"bucket-path": "\(Secrets.awsBucketPrefix)/\(tree.treeId)",
"bucket-path": uploadKey,
"x-amz-meta-datetaken": tree.createDate?.ISO8601Format(),
"x-amz-meta-supervisor": tree.supervisor,
"x-amz-meta-latitude": latitude,
Expand Down
2 changes: 1 addition & 1 deletion Unit Tests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>0.11.4</string>
<string>0.11.5</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down

0 comments on commit c0176ee

Please sign in to comment.