Can't get parameter in struts when using input type="file"...?

Hi everyone:
Can the common html tag and struts tag be used together?I have an example:in jsp
<html:form method="post" action="sendmail.do" enctype="multipart/form-data">
<tr><td>MailTo:</td><td>
<html:text property="mailto"/></td></tr>
<tr><td>MailFrom:</td><td>
<html:text property="mailfrom"/></td></tr>
<tr><td>Subject:</td><td>
<html:text property="title"/></td></tr>
<tr><td>Content:</td><td>
<html:textarea property="content" rows="7" cols="30"/></td></tr><tr><td>
Attach:</td><td>
<input type="file" name="myfile"/></td></tr><tr><td>
<html:submit/><html:reset/>
</td></tr>
</html:form>
In Action,I want to use the code "request.getParameter("myfile")" to get the file real path.But I always get "null".Why "request.getParamter("myfile")" is null although I choose a file in jsp?
Can struts Tag and html Tag be use together?Thks

Instead of the Request, you need to use MultiPart request in this case.
This is because of the following statement you are using in the form tag. {enctype="multipart/form-data"}
Hope it helps....

Similar Messages

  • Can I get audio through iPhone when using apple tv?

    Can I get audio through iPhone when using apple tv?

    What do you mean exactly? Are you wanting to output the audio to your iPhone while say watching a video on your Apple TV?  If so, I'm afraid it's not possible.  However, you should post this in the Apple TV forums for a better confirmation on then.  There are some prettty knowledgable people who hang out there.
    https://discussions.apple.com/community/appletv
    B-rock

  • Getting access denied error while importing file using input type="file"

    Hi All,
    I am using struts application wherein I need to import file for some purpose.I have used input type="file" for the same which goes like:
    <input type="file" id="uploadFile" name="uploadFile" size="50">
    I have the import button on which I have used onClick event to call javascript function submitValues() used to validate all the fields from the page which goes like:
    <input type="button" name="select" value="Import" class="CSSButton" onClick="javascript:submitValues();">
    The JS function then in turn submits the form and calls the action.The problem is sometimes even when the correct path is specified for the file to be imported results in access denied error.This error comes sometimes and other times it works fine.But when this error comes,I need to relogin into the application and then it works fine.I am using IE7 for this.
    Any idea why I am getting access denied error while importing? Has it got something to do with IE7 version or with the input type="file" which is being used here?
    Thanks for any help if anyone can provide.
    Edited by: passionateforjava on Mar 4, 2009 2:18 AM

    vishnuS1984 wrote:
    Hi Friends,
    I have gone through scores of examples and i am failing to understand the right thing to be done to copy a file from one directory to another. Here is my class...So let's see... C:\GetMe1 is a directory on your machine, right? And this is what you are doing with that directory:
    public static void copyFiles(File src, File dest) throws IOException
    // dest is a 'File' object but represents the C:\GetMe1 directory, right?
    fout = new FileOutputStream (dest);If it's a directory, where in your code are you appending the source file name to the path, before trying to open an output stream on it? You're not.
    BTW, this is awful:
    catch (IOException e)
    IOException wrapper = new IOException("copyFiles: Unable to copy file: " +
    src.getAbsolutePath() + "to" + dest.getAbsolutePath()+".");
    wrapper.initCause(e);
    wrapper.setStackTrace(e.getStackTrace());
    throw wrapper;
    }1) You're hiding the original IOException and replacing it with your own? For what good purpose?
    2) Even if you had a good reason to do that, this would be simpler and better:
    throw new IOException("your custom message goes here", e);
    rather than explicitly invokign initCause and setStackTrace. Yuck!

  • How can i invoke a file chooser dialog box with out using input type=file

    how can i invoke a file chooser dialog box with out using <input type=file> can any one help me mail me to [email protected]

    You could use an applet...
    Or maybe Javascript has some way to do it.

  • Uploading a file using input type=file

    Hi,
    I'm not sure if I'm in the right place or not. If not can you please let me know where to find and answer for my question.
    I'm trying to upload a file in oracle self-service (online page) and I found that the input type=file will let me select the file so I place the input type inside my htp.formopen command.
    I used the following when opening the formopen
    htp.formOpen(my_link, 'post',null, 'multipart/form-data');
    then I created the <input type="file"> tag
    But when I send the link to my second page to see if the input type works I get the page not found error.
    I'm thinking that maybe is because my 2nd page doesnt have a parameter that will hold the file but right now I'm not sure how to declare the file variables.
    Do you have any idea what could be wrong?
    Thanks

    What does your form do when you submit it? Handling file uploads is a bit of a convoluted process. I'd recommend starting here for some guidance:
    http://docs.oracle.com/cd/B14099_19/web.1012/b14010/concept.htm#i1005985

  • Can't get iTunes to close when using my iPod

    I have the original Touch, works just fine so why replace it.  However, lately when I download from iTunes, sync the new songs and then click the button to disconnect, I can't get itunes to close.  It keeps opening and finally in dispair, I resort to going to the Windows Task manager and close it that way which sometimes doesn't work until I've done it several times.  At the same time I get the new Apple rules and regs, I always click accept and it still opens and opens and opens.  Does anyone else have this difficulty?  Not thrilled with Apple taking over my computer.

    I have not heard of that problem before. You can try:
    - ANother cable and USB port
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    or        
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsync all music and resync
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up                                                                
    - Restore to factory settings/new iOS device.             
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
      Apple Retail Store - Genius Bar

  • Can't get sound to record when using isight in my macbook pro

    for some reason it just records the video no audio when using my macbook pro. any thoughts?

    flux302 wrote:
    for some reason it just records the video no audio when using my macbook pro. any thoughts?
    Verify your iMovie "Voiceover" audio source is set to use your MBP's internal Mic before you record.
      http://docs.info.apple.com/article.html?path=iMovie/7.0/en/10311.html
    (You might also need to change it in System Preferneces > Sound > Input.)
    Also verify the microphone's "Level" is not muted or adjusted too low in either place.
    Mac Pro Quad Core (Early 2009) 2.93Ghz w/Mac OS X (10.6.2)  MacBook Pro (13 inch, Mid 2009) 2.26GHz (10.6.2)
    LED Cinema Display  G4 PowerBook 1.67GHz (10.4.11)  iBookSE 366MHz (10.3.9)  External iSight

  • How can I get apostrophes to work when using auto spelling correction

    I use the shortcuts in System Preferences > Language and Region > Keyboard Preferences > Text. So for example I have "def" for "defendant". I've also put in "def's" for "defendant's" but when I type "def's", the shortcut doesn't work. Any suggestions? Or is it just something that must be added to the "to do" list at Apple?

    Using Safari ?
    Open System Preferences > Flash Player then select the Advanced tab.
    Click Delete All under Browsing Data and Settings
    Back to Safari. Press Command + Option + E to empty the Safari cache.
    Quit and relaunch Safari, try a video.

  • How to get the path of input type="file" tag

    -- im using <input type="file"> tag to get an input file from a local host, it returns only the filename but not the complete path of the filename,,,
    -- i need to know on how to get the compelete path /directory of the filename using <input type="file"> tag , or is there any other way to get an input file from a local host aside from <input type="file"> tag?
    thanks

    http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/input_file.asp?frame=true
    When a file is uploaded, the file name is also submitted. The path of the file is available only to the machine within the Local Machine security zone. The value property returns only the file name to machines outside the Local Machine security zone. See About URL Security Zones for more information on security zones.
    i need to know on how to get the compelete path /directory of the filename
    using <input type="file"> tag You can't. Its a security thing.
    is there any other way to get an input file from a local host aside from <input type="file"> tag?No. Not using just html.
    You could always go into activex components, but thats different again.
    Cheers,
    evnafets

  • From browse button of input type=file, can I show the content of a file

    Hi all,
    I am using, input type=file, where browse button appears. I am having a text area. My requirement is after I select the browse button, I need to show the content of the file in the text area. As of now I 've handled by having another button 'show', which should be pressed after browse done. But, How to handle it in the browse button itself, how will I get that action event from browse button. Plz help.
    Regards,
    Sam

    I think someone asked a very similar question here,
    http://forum.java.sun.com/thread.jsp?forum=45&thread=501889
    check the thread, it may help you.
    -S-

  • I need to get 2 decimal places when using a formula for a quotient and Numbers will only give me whole integers which is useless since most items will be less than 1. How can I change this?

    How do I get 2 decimal places when using a formula for a quotient? It only gives me whole integers. Most of the results will be less than 1 so I need 2 decimal places

    the quotient function returns only whole number portion of the dividing two numbers.  If you want the actual decimal value use the divide operator.  you enter this as:
    A/B
    if the numerator is in A1 and the denominator is in B1 you can enter the formula like this:
    =A1/B1

  • How can I get the App store to use money in my account rather than a credit card when I want to buy something?

    How can I get the App store to use money in my account rather than a credit card when I want to buy something?

    The iTunes/Mac App Stores use credit on an account first. You are asked to supply an additional payment method when the cash credit doesn't cover the complete cost of the purchase.

  • Can anyone explain why my Dell laptop and my iphone can "see" a server in Luton when using a wireless broadband (I get 20 Mbps download speed) but my ipad can not see this server and finds one in Milton Keynes which gives me 0.37 download speed.

    Can anyone explain why my Dell laptop and my iphone can "see" a server in Luton when using a wireless broadband (I get 20 Mbps download speed) but my ipad can not see this server and finds one in Milton Keynes which gives me 0.37 download speed.

    Can anyone explain why my Dell laptop and my iphone can "see" a server in Luton when using a wireless broadband (I get 20 Mbps download speed) but my ipad can not see this server and finds one in Milton Keynes which gives me 0.37 download speed.

  • How to transfer range parameter from vb when using bapi calling

    Hi,everyone.how to transfer range parameter from vb when using BAPI calling?

    Did you get the solution to your problem?  Can you please share it with me. I have a similar problem. I have a VB program that calls RFC function. It works with a single parameter but not with a range of parameters. If you have the solution, could you please share sample codes with me? Thank you so much.

  • I can't get past white screen when starting up, any ideas?

    I Can't get past white screen when starting up, any ideas

    http://support.apple.com/kb/TS2570 Mac OS X: Gray screen appears during startup
    ===============
    When posting in Apple Communties/Forums/Message Boards.......It would help us to know which Mac model you have, which OS & version you're using, how much RAM, etc. You can have this info displayed on the bottom of every post by completing your system profile and filling in the information asked for.
    CLICKY CLICK---> https://discussions.apple.com/docs/DOC-3602
    CLICKY CLICK-----> Help us to help you on these forums

Maybe you are looking for

  • Image Transperancy in bitmapData

    Folloing are the excerpts of my code in AS2: I have image1 as and image2 on my stage. The image2 is a transparent GIF and works good transparantly when moved, roatated etc. this image2 is merged over image1 on a button click instance. Problem with th

  • FCP 6 won't unhide.

    anybody found a solution for this? I searched the forum but the related topics failed to provide useful info. This problem is happening on another system running leopard btw.

  • Problem with a data type (quantum13.3) in the mapping

    Hello all, i have an automated activity in my process which access to a webservice. (The Webservice returned the details of a purchase requisition) At the webservice output mapping i get this error: "Incompatible expression type ... Expected: com.sap

  • Handling Currency Symbol 'u00A3' in XI

    Hi,      The file that we are using in Inbound to SAP scenario is likely to have '£'        symbol. When the file goes through Content Conversion XI takes it as '‚£'      which is two characters long.      This is causing the mapping of other fields

  • RSS feeds not updated

    The rss feeds on: http://www.oracle.com/technology/syndication/rss_otn_dev.xml are not updated.