How to upload the file by java?
How to upload the file by java?
F.Torres
Posts: 12Questions: 4Answers: 0
some of my recent research,I know how to display the file,But the key is I can't get the stream in the server,and the file must save in the database? and must create a table to save the file id、path and so on?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I'm afraid I know next to nothing about Java. You'd need to ask in a Java specific programming forum or StackOverflow about how to read a file from an HTTP upload.
Regards,
Allan
by this code,I can attribute the name and id to the input where type = text
attr:{
name:"imgUrl",
id:"imgUrl"
}
but I can't attribute the input where type = 'file'
by attr id and name,I think I can send the stream to the server
The
upload
field type is what Editor uses for file upload.Allan
I think the api is to little...
and Should I attr the enctype="multipart/form-data" in the form?
but I can't find
No - the
upload
field type uses XHR requests to upload the document. Documentation for it is available here.Allan
I don't know what should I write by the upload,It is display the type is the File!
That presumably shows a
upload
field type and let's you select a file, correct? Then when you select the file it sends the file togetRootPath()+"/back/club_course_upload.do"
, correct?Allan
I can debug with the path,but I can't get the stream
I don't really know what you mean I'm afraid. The stream in Java? As I say, I know next to nothing about Java - you'd need to ask on StackOverflow or a Java specific forum.
Allan
Your answer it's true,my understanding of editor is not deep enough,and it makes me a lot of trouble,thanks by your answer although I often can't express myself clearly.