Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Append .jpg file extension for upload #116

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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