Skip to content

Support content-type option #63

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions Example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ android {
}

dependencies {
compile project(':react-native-image-picker')
compile project(':aliyun-oss-react-native')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
implementation project(':react-native-image-picker')
implementation project(':aliyun-oss-react-native')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:23.0.1"
implementation "com.facebook.react:react-native:+" // From node_modules
}

// Run this once to be able to run the application with BUCK
Expand Down
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ repositories {
}

dependencies {
compile 'com.facebook.react:react-native:+'
compile 'com.aliyun.dpa:oss-android-sdk:+'
implementation 'com.facebook.react:react-native:+'
implementation 'com.aliyun.dpa:oss-android-sdk:+'
}


Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ public void asyncUpload(final ReactContext context, String bucketName, String os
// init upload request
PutObjectRequest put = new PutObjectRequest(bucketName, ossFile, sourceFile);
ObjectMetadata metadata = new ObjectMetadata();
metadata.setContentType("application/octet-stream");

metadata.setContentType(options.hasKey("content-type") ? options.getString("content-type") : "application/octet-stream");
put.setMetadata(metadata);

// set callback
Expand Down