언어 설정

Menu
Sites
Language
Image Input OnFile Chosen

So I'm using a file input to let a user select an image. Once an image is chosen it shows a green circle to the left showing it's selected but the file input page never disappears and I don't see any button which a user can click that lets them go back to the app. The only thing that can be done is clicking the home button to exit the application and when you re-open the application the input screen has been closed.

Has anyone had experience in using the file input?

Responses

4 댓글
talari praveen kumar

Hi

Will you please share the code to test?

Philip Kirkbride

The function which runs and successfully invokes the Tizen file picker is the following. 

           changeBg: function(event) {
                var fReader = new FileReader();
                fReader.readAsDataURL($('input[type=file]').get(0).files[0]);
                fReader.onloadend = function(event){
                console.log(event.target.result)
                $('#myModal').css('background', 'url('+event.target.result+') no-repeat scroll center top');
                $('#myModal').css('background-size', '100% 100%');
            }

 

This code runs when the element below has been changed

            <input class="hidden" id="picture" type="file" name="file" accept="image/*" />

 

On other platforms it works this way.

1. User clicks input and file picker invokves.

2. Once a file has been chosen the .change() event is triggered on the input causing changeBg to run.

 

As mentioned on Tizen step one works but there is nothing within the UI to finalize your selection and thus causing 2 to trigger.

talari praveen kumar

Hi

Try with below code

<input type="file" id="uploadfile" name="uploadfile" />

Once u click on upload file you will get input page, after selecting an image  it shows a green circle to the left showing it's selected, then click on "Attach" which is present at the bottom of the page, then you will be redirected to your app.

Philip Kirkbride

I'm not sure how to upload a screenshot using this form but I get everything you described but after I see the green circle there is no 'Attach' button.