Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
We have wrote a html code to upload file as follows:
<h3>File Upload</h3>
<form action="UploadServlet" method="post" enctype="multipart/form-data">
<input type="file" name="file">
<button type="submit">Upload File</button>
</form>
Need code in UploadServlet.jsp to fetch the document and attach it to the secondary attachment of the current wtDocument.
Thanks!
Curious what is wrong with the normal check out and edit interface to upload via attachments?
I’ve written lots of code to get content and to add content.
I take it “name” in your form it the full path to the file? If yes, and you have the document (which I guess is the the document you are running the jsp from) to add the file from a given path as an attachment to the document is no problem.
Does that accurately describe the big picture?
If yes, I’d second what Mr Villanueva wrote.
If no, how about describing your use case.