This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSF and the fly likes JSF Tomahawk File upload problem  calculating image file size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF Tomahawk File upload problem  calculating image file size" Watch "JSF Tomahawk File upload problem  calculating image file size" New topic
Author

JSF Tomahawk File upload problem calculating image file size

vijay k vemula
Greenhorn

Joined: Dec 17, 2008
Posts: 10
Hi All,

currently i am working on File Upload functionality in JSF + Tomahawk. I got a new requirement where i need to display file size as soon as user clicks on "Browse" button and selects the file. I am using <t:inputFileUpload>.... I tried with the following approach but its not working.

i used "onchange" event on <t:inputFileUpload> and invoking the following Javascript function to calculate the file size.

function getFileSize(path)
{
alert(path);
image.src = path;
alert(image.src);
alert(image.fileSize);
}

The above javascript function is working fine when i tested individually but not working when i include in my JSF page <script> section.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
You've already posted this before: http://www.coderanch.com/t/422468/JSF/java/JSF-Tomahawk-File-Upload

[edit]Answer removed. You crossposted it again: http://forums.sun.com/thread.jspa?threadID=5357348&tstart=0

Good luck further.
[ December 24, 2008: Message edited by: Bauke Scholtz ]
 
wood burning stoves
 
subject: JSF Tomahawk File upload problem calculating image file size