![]() ![]() txt file, it works and I can open the temp.txt. Then, I convert the string I get from stringbuilder to InputStream: InputStream is = new ByteArrayInputStream(result.getBytes("UTF-8"")) įinally, I write this InputStream is to another file(temp) by using the following code: OutputStream outputStream = new FileOutputStream(temp) // temp is a file. for image upload in jsp using file upload control into a blob field, i have downloaded jar file and included in my projects lib folder. Sb.append(line) // sb is stringbuilder here It also contains a submit button to submit the uploaded image to the server. Then I use this code to get the string of the file content BufferedReader br = new BufferedReader(new InputStreamReader(whole, "UTF-8")) Then I use this code InputStream whole = request.getInputStream() to get the whole inputstream. For using this class you must have cos.jar file. I am going to use MultipartRequest class provided by oreilly. IMPORTANT: I can ONLY use "servlet-api.jar(2.4 version)", I cannot use other JAR! Any file input field thats left empty will result in a FilePart with null contents. ![]() What I wanna do here is user uploads his file and I will store this file into my server side ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |