Problem with Struts file upload with small files

For some reason, when I try to upload a file that is smaller than 45 bytes using Struts (took me a long time to find this number), by the time the file is populated in my form bean and I read the size from it, the size is 0. Has anyone encountered this problem before?
I created a file called test.txt, which contained the following text in it: "This is a test.". This file is about 15 bytes in size. When I was trying to upload this file using Struts, and write it to a temp file, my temp file always was of size 0. At first I was convinced it was my code, but then I tried a Word file (about 19kb), and it worked fine. Finally, I added some debug code at the beginning of my execute() method in my action to print out all the metadata for uploaded files, and I saw the the file size was 0 for files smaller than 45 bytes. I printed this just after I cast the form to be the type of form that I needed. What is happening to the contents of the file? Does Struts have a minimum size limit of files that it is able to process?
Any help is greatly appreciated!

AFter some more testing, I found that this is only a problem when using Firefox and Netscape. When using IE, files as small as 1 byte were properly uploaded, and the size was accurate when queried from FormFile.getFileSize().
Does anyone have any ideas as to what may be happening in this case? Why it would work fine in one browser and not the other?

Similar Messages

  • Problem with Small Caps

    I have a problem with small caps when using Times New Roman and Helvetica, but not when using Adobe Garamond Pro, and would like to find out why.
    I generate the small caps within InDesign by the "TT" box in the Control Window. Adobe Garamond comes up with beautiful small caps that blend in with the surrounding text. When I do the same with Helvetica, the small caps, especially if they have normal caps amongst them, are quite inelegant looking because of different letter widths.
    So I did some experiments with half a dozen other serif and sans-serif fonts and none of them were as elegant as Adobe Garamond Pro. For a sample of what I mean, download:
    http://www.mediafire.com/?z5fm0zndmzm
    which compares three fonts: Adobe Garmond, Heletica, and Times New Roman.
    Unfortunately, I did not pick up this problem until I received my first proof from the printers, and now I will have to change all the Helvetica small caps to normal caps, as I can see no other way of overcoming this inelegancy.
    I checked in New Scientist magazine (it uses a serif and sans-serif font throughout, and what I thought I remembered as small caps to begin their stories) to see what they do, but they actually use caps instead of small-caps at the beginning of stories.
    Three questions:
    Q1: Is the way I generate small caps the correct way?
    Q2: Is there something wrong with my Helvetica and Times New Roman fonts?
    Q3: Could it be that only Adobe Garamond has an internal, properly designed small caps?
    I have checked the attributes of the fonts: Garamond is Open Type Postscript, Helvetica is PostScript Type 1 , and Times New Roman is TrueType.
    Any comments most appreciated.

    Thanks for the hints. I tried Scott's method and it works with a bit of extra adjustment. The settings I obtained for 12 point Helvetica were:
    Horizontal and vertical scaling: 70.5%;
    Stroke: 0.1 pt
    Tracking: +25 em
    Baseline shift: +0.1 pt
    The steps to obtain small-caps 12 pt Helvetica are:
    Step 1: Type text as normal.
    Step 2: Select only the lower-case text you want to convert to small caps. i.e if what is to become small caps already has a capital (such as a place name) do not apply the settings to the capitals, unless that's the effect you want.
    Step 3: Apply the above settings manually or via or Character Style.
    Problem 1: How do I rid my Character Style of the font size so that only the scaling factors remain? As it is, if I want to apply small-caps to a different font size than the one I have set up, I have to manually change the font size after applying the style.
    Problem 2: The scaling factors do not appear to work for changes in font size. When I used 24 pt and applied the above settings, the small-caps were too thin. The method only really works for a particular size, which in reality is all you would normally require.

  • Fop 0.19 problems with small files?

    Hello!
    I have a problem with fop 0.19 serializer: when I try to generate
    pdf files smaller then cca. 10kB, IE does not open Acrobat
    Reader, and sometimes even freezes. With larger files, it works
    OK.
    My configuration:
    Tomcat 3.2
    XDK 9.0.2.0b
    fop 0.19
    Thanks in advance!
    Vedran

    Hi Eric/Steve,
    I have downloaded the Xml development kit for Java (9.0.2.0.0C
    beta) and created a new xsql RTF-serializer class according to
    the XSQLSampleSerializer included in the xsqlserializer.jar file.
    I also included Eric's CustFOP-serializer.
    I can compile my new class with JDeveloper but when i recreate
    the xsqlserializer.jar and try to use this jar-file with the
    xsql servlet i get an error.
    The error is "XSQL-022: cannot load serializer class
    oracle.xml.xsql.serializers.XSQLxxxSerializer", with xxx my own
    serializer, but also when i use the original FOP-serializer.
    So i think the jar-file is not correct.
    Can anyone tell me how to recreate the xsqlserializer.jar or
    tell me what else i have done wrong?
    (I also posted this question in the JDeveloper-forum)

  • Pdf reader X has problems with small pdf and printer with post script driver

    Hi friends.
    I have installed new Reader X and then i saw that, when i print a very small pdf with about 50 kb and i print it on a Laserjet 4000 printer the printer has problem with the amount of data that reader 10 produces.
    When i install a Postscript driver for the printer my computer makes up to 3.5MB printer data from a 50kb pdf.
    When i install a PCL driver for the printer my computer makes only 350kb from the same 50kb pdf file!!!!
    When i install Reader 9.3 the 50kb file becomes also only 350kb on the printer with post script driver, and i can print without problems also.
    my printer has 8 MB Ram and that should be enough for 3.5MB printer data.
    But when i print the pdf with 1 side only, the printer created a side who is only filled with 50% of the text, then there comes out a second page with the message.....not enough memory in the printer.
    i can not change the postscript driver to a pcl driver cause our ERP System can not handle printer with PCL drivers.
    Can someone help me please.........are there settings in Reader X who can solve my problem ???
    Thank you very much for help!

    put ? after rwcgi60.exe

  • Dreamweaver CS3 problem with small fonts

    Hello,
    I am having a problem with text appearing
    REALLY SMALL and unreadable in CS3, when it looked fine in
    Dw8. It also looks fine in in all browsers.
    I talked to Adobe tech support, and they said something about
    my CSS file not being correct. I looked at it, and nothing seems
    out of the ordinary.
    If it was a problem with my CSS file, wouldn't it look bad in
    the browser as well?
    Any suggestions?
    Ron

    Ron,
    Thanks for the sample file. This is a bit complicated, so
    please bear
    with me.
    Up until DW8, DW rendering always targeted the most popular
    browser at
    that time. For DW8, that was IE6. Traditionally, the most
    popular
    browser was the most popular because it was the best browser,
    but that
    no longer holds true. So, DW CS3 now targets CSS 2.1. Note
    that DW does
    not support all of the CSS 2.1 spec, but what it does support
    follows
    the spec.
    Your page does not have a DOCTYPE, so it renders in "quirks"
    mode in the
    browsers that I tested it in on WinXP (FF2, IE7, Opera9). DW
    renders
    this page in IE6 quirks mode, but DW CS3 no longer supports
    quirks mode.
    Put a DOCTYPE such as the following in your page to see what
    I mean:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN"
    http://www.w3.org/TR/html4/loose.dtd">
    The reason that the font is so small is because of the
    font-size
    property in this rule:
    TD {
    FONT-SIZE: 80%;
    Your page has tables nested 4 levels deep, so the 80% is
    compounded at
    each level. I fixed this in DW CS3 by creating a style sheet
    with this rule:
    TD { FONT-SIZE: 100% !important; }
    and the applied it as a Design-time Style Sheet, although you
    may be
    able to remove the 80% altogether.
    Hope this helps,
    Randy
    > Here's a link to the page:
    >
    http://www.ualberta.ca/AICT/IMS/
    >
    > You should be able to download the source for the page,
    if you so desire...!
    >
    > Thanks in advance for any suggestions...

  • Problem with small text in iview header

    hi,
    i got a little problem with iView header.
    I've set 2 pages containing the same iViews. The 2 pages have layout (1 column full width -- standard) and the 2 pages have the same properties, themes.
    The problem is that in the first page the header text is very small and in the second one the header text display correctly.
    Have anyone had this problem and how did you solve it ?
    Thanks in advance.

    Hi,
    I don't have a straight answer but:
    1. Have you tried creating a copy of the page which is working correctly?
    2. Why do you need two pages with the same content? Personally, I can't see any reason for maintaining two identical objects.
    Roy

  • A problem with small circles drawing...

    I can't draw small circles and dots. Don't advise me to use the zoom. Is it a normal issue for Samsung Note 10.1 or Photoshop Touch?

    I have the same problem on my samsung galaxy note 10.1 and PS touch v 1.2.0 (can't upgrade it without new official firmware).
    And I really don't know how to post screenshot with items that cannot be painted with your software.
    On this device drawing is done with stylus (If you dont know). Stylus provide great precision and allow to paint small details.
    The problem is that brush does not start drawing immediately after stylus touching the screen. Instead of this it waits until user will move stylus away from start point by 3 millimiters. And only after that photoshop will draw the first segment of line. If you try to draw small circle with diameter of 3 mm photoshop will draw just start point. Because stylus will never leave 3 mm area around touching point. this also means that you can't draw lines with length less than 3mm.  And this also means that every line will start with 3mm straight segment.  So you can't draw small details.
    This small thing (and also bugs with smudge and blur tools and opacity problems with brush and awful color picking tool) made painting with photoshop really tricky.
    Maybe you made this 3mm margin to make your color picker work (which pick color only after touching the screen and then pressing side button). But it is unobvious for users (as you can see by questions on yor forums) and bring some additional problems with painting (as you can see in this post).
    And what is really terrible is that I can't just delete your useless software without root rights because it was preinstalled by samsung. 
    Best regards.

  • I am having problems with small text size on AOL mail, and am using the latest version of Firefox.

    I am having problems with text size when using AOL Mail. I am using version 25.0 of Firefox. I did not have this problem in the past, but I suspect a change occurred with one of the Firefox upgrades. I do not have the same problem when using Internet Explorer.

    Could you start by resetting the zoom level on the page? To do that, you can either:
    * Press Ctrl+0 (that's a zero) on the keyboard
    * View menu > Zoom > Reset
    You also can use zoom to increase/decrease the size from there. This article describes the various mouse, keyboard, and menu methods: [[Font size and zoom - increase the size of web pages]].
    Any luck?

  • Problem with small .pct files from PC becoming big when saved on Mac

    For a big database project with Photoshop images, I create bitmap files in PS CS3 and save them as .pct files. They are 4-5 KB each.
    I then email them to someone with a Mac (all versions from CS2-CS5) who must open the files in PS to get the Mac database to see them. When she saves them on her Mac without making any changes, the files are 60-70 KB.
    How can we preserve the small files on the Mac?
    Thanks!

    1. When she receives the files in my email, they are still small. When she opens them in Photoshop and saves them, they become about 12 times bigger.
    Is there a way on the Mac to strip out the thumbnails and other info that is making the files bigger?
    2. The database program, Panorama, has the user link to the images, which are in separate folders. However, the image does not appear in Panorama unless she opens the file in the Mac version of Photoshop and saves it, even without making changes. I assume that is an oddity of Panorama, but we are stuck with it.
    Thanks so much for your quick response.

  • Microsoft Jet Provider problem with small or big numbers numbers

    I'm using an script component as a source to process excel files.  Inside the component I'm suing the Microsoft Jet provider with the OleDb connection to open and read the data in the excel file.  Several of the columns on the spread sheet are
    numeric and some of the values are very small.  I found out that when the value is very small the number is represented using the scientific notation, so when the provider try to convert the value to a number fails and send a null value instead.  Does
    anyone know a way to solve this problem?  The reason I'm using an script component is to process multiple file formats in one data flow task using a loop through iterate through all the excel files.
    Thanks,
    Alberto Botero
    Alberto Botero

    Hi Alberto,
    Thank you for your question. I am currently looking into this issue and will give you an update as soon as possible.
    Thank you for your understanding and support.
    If you have any feedback on our support, please click
    here.
    Elvis Long
    TechNet Community Support

  • Problem with small java program

    need some help with a small Java assignment I am doing.
    When I compile the code i get 2 errors they are
    invalid method declaration: return type required
    public CreateRandomFile() LINE 87
    ^
    cannot resolve symbol
    new CreateRandomFile(); LINE 112
    ^
    Any help is greatly appreciated
    **********CODE BEGINS HERE ***********************
    import javax.swing.*;
    import java.io.*;
    import BreezySwing.*;
    public class RandomTest extends GBFrame
    JLabel accLabel = addLabel("Account Number",1,1,1,1);
    IntegerField accField = addIntegerField(0,1,2,1,1);
    JLabel firstLabel = addLabel("First Name",2,1,1,1);
    JTextField firstField = addTextField("",2,2,1,1);
    JLabel lastLabel = addLabel("Last Name",3,1,1,1);
    JTextField lastField = addTextField("",3,2,1,1);
    JTextArea resultArea = addTextArea("",4,1,2,3);
    JButton acceptButton = addButton("Accept",7,1,2,1);
    JButton accessButton = addButton("Access",8,1,2,1);
    JButton clearButton = addButton("Clear",9,1,2,1);
    private RandomAccessFile file;
    public void buttonClicked(JButton buttonObj)
    if (buttonObj == acceptButton)
    else
    if (buttonObj == accessButton)
    else
    accField.setNumber(0);
    resultArea.setText("");
    firstField.setText("");
    lastField.setText("");
    private void openFile()
    FileOutputStream foStream = new FileOutputStream ("acc.dat");
    ObjectOutputStream doStream = new ObjectOutputStream (foStream);
    if ("acc.dat" == null || "acc.dat".equals(""))
    System.out.println("Invalid File Name");
    else
    try{
    file = new RandomAccessFile ("acc.dat","rw");
    catch (IOException e)
    System.out.println("File does not exist or Invalid File Name");
    private Record getRecord()
    Record record = new Record();
    int accountNumber;
    try{
    accountNumber = Integer.parseInt(accField.getText());
    if (accountNumber <1 || accountNumber >100)
    System.out.println("Account doesn't exist");
    return null;
    file.seek((accountNumber -1)*Record.size());
    record.read(file);
    catch (NumberFormatException nfe)
    System.out.println("Account does not exist");
    System.out.println("Invalid Number Format");
    catch (IOException io)
    System.out.println("Error reading file");
    return record;
    public createRandomFile() // <----- ERROR HERE
    Record blank = new Record();
    openFile();
    try{
    file = new RandomAccessFile("acc.dat", "rw");
    for (int i=0;i<100;i++)
    blank.write(file);
    System.exit(0);
    catch (IOException e )
    System.out.println("File doesn't exist");
    System.out.println("Invalid File Name");
    System.exit(1);
    public static void main(String args[])
    JFrame tpo = new RandomTest();
    tpo.setTitle("Assignment 1");
    tpo.setSize(200,330);
    tpo.setVisible(true);
    new createRandomFile(); // <--- ERROR HERE
    }

    I changed the things you suggested by have a new error of
    cannot resolve symbol
    symbol : method createRandomFile ()
    location: class javax.swing.JFrame
    tpo.createRandomFile();
    ^
    **************new code here***************************
    import javax.swing.*;
    import java.io.*;
    import BreezySwing.*;
    public class RandomTest extends GBFrame
         JLabel accLabel = addLabel("Account Number",1,1,1,1);
         IntegerField accField = addIntegerField(0,1,2,1,1);
         JLabel firstLabel = addLabel("First Name",2,1,1,1);
         JTextField firstField = addTextField("",2,2,1,1);
         JLabel lastLabel = addLabel("Last Name",3,1,1,1);
         JTextField lastField = addTextField("",3,2,1,1);
    JTextArea resultArea = addTextArea("",4,1,2,3);
    JButton acceptButton = addButton("Accept",7,1,2,1);
    JButton accessButton = addButton("Access",8,1,2,1);
         JButton clearButton = addButton("Clear",9,1,2,1);
         private RandomAccessFile file;
    public void buttonClicked(JButton buttonObj)
         if (buttonObj == acceptButton)
         else
         if (buttonObj == accessButton)
         else
         accField.setNumber(0);
         resultArea.setText("");
         firstField.setText("");
         lastField.setText("");
    private void openFile()
         FileOutputStream foStream = new FileOutputStream ("acc.dat");
         ObjectOutputStream doStream = new ObjectOutputStream (foStream);
         if ("acc.dat" == null || "acc.dat".equals(""))
         System.out.println("Invalid File Name");
         else
         try{
              file = new RandomAccessFile ("acc.dat","rw");
         catch (IOException e)
              System.out.println("File does not exist or Invalid File Name");
    private Record getRecord()
         Record record = new Record();
         int accountNumber;
         try{
              accountNumber = Integer.parseInt(accField.getText());
         if (accountNumber <1 || accountNumber >100)
              System.out.println("Account doesn't exist");
              return null;
         file.seek((accountNumber -1)*Record.size());
         record.read(file);
         catch (NumberFormatException nfe)
         System.out.println("Account does not exist");
         System.out.println("Invalid Number Format");
         catch (IOException io)
              System.out.println("Error reading file");
    return record;
    public void createRandomFile()
    Record blank = new Record();
    openFile();
    try{
         file = new RandomAccessFile("acc.dat", "rw");
         for (int i=0;i<100;i++)
         blank.write(file);
         System.exit(0);
    catch (IOException e )
         System.out.println("File doesn't exist");
         System.out.println("Invalid File Name");
         System.exit(1);     
    public static void main(String args[])
    JFrame tpo = new RandomTest();
    tpo.setTitle("Assignment 1");
    tpo.setSize(200,330);
    tpo.setVisible(true);
    tpo.createRandomFile();
    }     

  • Problem with "small black line in right margin" with Folio Builder / Adobe Viewer in Ipad. Id CC.

    Hi there,
    When I create a Folio Builder and I check my Id project in the Adobe Viewer (It happens in the Ipad App and in the Desktop Viewer), I can see a black line in the right margin (maybe 4 px). And I can't adjust my background (It's an object with a colour) to use the "full resolution available for the app in the ipad", and yes, I'm using rules and I can see that my background object it's 1024 x 768. I have tryed several projects and upgraded the project to the "30 version".
    But I'm a new user with ID/DPS. So, is this a reported bug? Or I'm doing sth wrong?
    And for me, the most important question, will this problem be solved when I send my project to the applestore and DPS transform my Folio to the Store? Or what I see now it's what I will see?
    Thanks!

    Sorry! I have found an answer here in the discussion:
    http://forums.adobe.com/message/5835960#5835960
    So, the problem will be solved in the final app, and it's just the scroll in the Viewer.
    Thanks!

  • [Struts]File upload doesnt work with "Create" but works with "CreateInsert"

    Hello,
    thank you for reading this!
    Im facing serious issue with web application built with JSP, Struts & ADF BC in jdeveloper 10.1.3.1 and jdeveloper 10.1.3.2 (same code works perfectly in older jdev versions)
    File upload to DB only works if CreateInsert is selected in PageDefinition. (Have to change from default "Create" to "CreateInsert")
    If I set "Create" i get this problems:
    - if VO is empty the row cannot be created (no error is returned, i click ОК and row is not commited, its just discarded)
    - if VO is not empty instead to create new row current row is updated.
    This only happens with "multipart/form-data" forms. With plain form row is created without the problem.
    If I change to "CreateInsert" then I can add new rows with "multipart/form-data" but i would prefer "Create" because it avoid the blank row issue...
    Old 10.1.3 works with "Create" and "multipart/form-data".
    Im aware of this problem since the 10.1.3.1 release but I havent posted on the forum because I hoped Oracle is aware of this problem but since the problem remains I decided to react. I do not have the metalink account so only way to address the issue is in this forum.
    Please Help.
    Sanja

    I had some problem with 'Create' earlier with 10.1.2. Then I kept recreateing the pages and then it worked finally. How are you creating the page for 'create' event. Is it like, first displaying the rows from the table with create button, or are you right away creating the page from menu option.

  • Have been trying all weekend to upload Jpegs- either Send does not work or shows files uploading then shows error- never had this problem with Send Now-16 images total size 92MB-largest image 13MB

    Have been trying all weekend to upload Jpegs- either Send does not work or shows files uploading then shows error- never had this problem with Send Now-16 images total size 92MB-largest image 13MB

    Hi Ciaran19,
    Are you sending files from the Adobe Send interface, Adobe Reader, or the Outlook plug-in?
    Have you checked to see whether the files that you're sending appear in the Recent Files/Sent Files list when you're logged on to https://cloud.acrobat.com? (It could be that they're uploading, but not being sent.)
    It would also be worthwhile to send the files in smaller batches, to see whether a particular file or files is problematic, and causing the error.
    Please let us know how it goes. If you're still having trouble, please let us know where you're sending from, and whether you're able to send the files in smaller batches. It would also be helpful to know the exact error message that you're receiving.
    Best,
    Sara

  • I am having some huge problems with my colorspace settings. Every time I upload my raw files from my Canon 5D mark II or 6D the pics are perfect in color. That includes the back of my camera, the pic viewer on my macbook pro, and previews. They even look

    I am having some huge problems with my colorspace settings. Every time I upload my raw files from my Canon 5D mark II or 6D the pics are perfect in color. That includes the back of my camera, the pic viewer on my macbook pro, and previews. They even look normal when I first open them in photoshop. I will edit, save, and then realize once i've sent it to myself to test the color is WAY off. This only happens in photoshop. I've read some forums and have tried different things, but it seems to be making it worse. PLEASE HELP! Even viewing the saved image on the mac's pic viewer is way off once i've edited in photoshop. I am having to adjust all my colors by emailing myself to test. Its just getting ridiculous.

    Check the color space in camera raw, the options are in the link at the bottom of the dialog box. Then when saving make sure you save it to the srgb color space when sending to others. Not all programs understand color space and or will default to srgb. That won't necessarily mean it will be accurate, but it will put it in the ballpark. Using save for web will use the srgb color space.

  • Problem with uploading a file in Clustered Environment

    Hi,
    I have a problem with uploading a file in a clustered environment. I have an iview component which facilitates an upload action of an xml config file. The problem is that the upload of the modified XML file is reflected only in the central instance of the cluster and not in the dialog instances. The dialog instances hold the old config file.
    Is there any solution to upload the file to all the nodes in the cluster.
    Thanks
    Kiran

    Hi,
    This is a known problem with clustered environment. Remember that your portal component runs on just on dialog instance and it doesn't automatically have access to the other nodes.  However, there are some ways to get around this
    1. Use KM to store files. KM is a common repository for all application servers and therefore you needn't worry more
    2. Use an external batch oriented product (suresync/robocopy) to synch folders on the different DIs. You basically use your existing portal component, but there is a batch job which makes sure the upload folder is identical on all DIs (however, there is a slight delay depending on how often you run the batch job)
    3. Store the files on a shared disk directly from the portal component.
    Cheers
    Dagfinn

Maybe you are looking for