ibm mobilefirst - how to upload the image in worklight -


how can upload image sql database?

current mysql query:

create table upload ( id int not null auto_increment, name varchar(30) not null, type varchar(30) not null, size int not null, content mediumblob not null,  primary key(id) ); 

html file

<form method="post"  enctype="multipart/form-data">    <input type="hidden" name="max_file_size" value="2000000">    <input type="file" id="userfile"  name="userfiles">  <br>    <input type="submit"  id="upload" value="uploadimage "name="uploads"onclick="upload()">       </form> 

i don't know sql query, doesn't tell much.

what need base64 encode image , save string database.
when want pull image , display it, need decode string image.


Comments

Popular posts from this blog

javascript - How to name a jQuery function to make a browser's back button work? -

python - Django-easy-pdf: xhtml2pdf reporting reportlab 2.2+ is required, but 3.0 installed -

collision detection - C++ library for mesh to mesh intersection: what is available? -