Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Struts and the fly likes Getting the full pathname from FormFile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Getting the full pathname from FormFile" Watch "Getting the full pathname from FormFile" New topic

Getting the full pathname from FormFile

Clarence Dyho

Joined: Sep 17, 2001
Posts: 23

I used the <html:file> tag provided by Struts for file upload. However, I need to check if the file actualy exist before I do the transfer so I need the full path and file name. Could anyone tell me how I could get this? The getFileName() method of FormFile only returns the base file name.

I read somewhere that the Jakarta commons upload class such as the CommonsMultipartRequestHandler can be used to get the full file name. Can't seem to make it work and I can't find any examples. Also tried to look for threads with similar subject here but most of them have no replies.

Thank you.
It is sorta covered in the JavaRanch Style Guide.
subject: Getting the full pathname from FormFile
Similar Threads
html:file problem
Upload all the files in the directory to server
Get path of file uploaded
Can't get details on form file...
absolute path Formfile upload