This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JForum and the fly likes File upload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "File upload" Watch "File upload" New topic

File upload

Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
I try to extend the forum. I create a page where there is a form to upload a file. In the action (referred to this page) I must insert the code to upload the file.
Here there are my problems.

I try to insert this code:

But the request I have in JForum (this.request) is a RequestContext and not an HttpServletRequest class.
How can upload a file in JForum? Do I have to use some particular classes?

Thanks, bye bye.

[originally posted on by abdujaparov]
Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
For testing and portability jForum uses it's own interface (RequestContext). This allows for some jforum code to be tested outside of the web server environment.

However, in the web environment, the class that implements this interface in the web environment is just a HTTPServletRequest wrapper. This mean you can cast the RequestContext object as a HTTPServletRequest class and get all the methods.
[originally posted on by monroe]
Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
hi, abdujaparov

Where you put this code? :idea:
[originally posted on by Carlos_ds_jar]
I agree. Here's the link:
subject: File upload
Similar Threads
GWT fileuploading error
commons file upload
To know about File Upload
Submit multipart and form data
Cannot recognize conten type = "multipart/form-data" in JSP