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

File picker doesn't work #15

Closed
dalb8 opened this issue Jan 27, 2013 · 3 comments
Closed

File picker doesn't work #15

dalb8 opened this issue Jan 27, 2013 · 3 comments

Comments

@dalb8
Copy link

dalb8 commented Jan 27, 2013

CM10: working with stock browser. I can't use any button that is used for "Choose File" e.g https://f-droid.org/translate/ru/fdroidclient/edit.html .

@demitrios
Copy link

Great browser! Please fix this issue. I believe the changes below will allow allow the file picker to function again.

IN FILE, CustomWebChromeClient.java, REPLACE

public void openFileChooser(ValueCallback uploadMsg) {
mUIManager.setUploadMessage(uploadMsg);
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("/");
mUIManager.getMainActivity().startActivityForResult(
Intent.createChooser(i,
mUIManager.getMainActivity().getString(R.string.FileChooserPrompt)),
TintBrowserActivity.ACTIVITY_OPEN_FILE_CHOOSER);
}

WITH

// Android 4.1+
public void openFileChooser (ValueCallback cb_uri, String accept, String capture) {
if ((accept == null) || (accept.length() == 0)) accept = "/";
mUIManager.setUploadMessage(cb_uri);
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType(accept);
mUIManager.getMainActivity().startActivityForResult(
Intent.createChooser(i,
mUIManager.getMainActivity().getString(R.string.FileChooserPrompt)),
TintBrowserActivity.ACTIVITY_OPEN_FILE_CHOOSER);
}
// Android 3.0+
public void openFileChooser (ValueCallback cb_uri, String accept) {
openFileChooser(cb_uri, accept, null);
}
// Android < 3.0
public void openFileChooser (ValueCallback cb_uri) {
openFileChooser(cb_uri, "/");
}

@ElementW ElementW mentioned this issue Jun 3, 2013
@Anasthase
Copy link
Owner

Resolved by gravgun's pull request, thanks to both of you.

@babam86
Copy link

babam86 commented May 19, 2014

Yes, I am experiencing the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants