• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

file upload in spring

 
Ronwaldo Cruz
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to know whether a file path is invalid during file upload using Spring form tag (In lower versions of IE, the path can be edited). I intended to do this using

<form method="post" action="upload.form" enctype="multipart/form-data">
<input type="file" name="file"/>
<input type="submit"/>
</form>

FileUploadBean bean= (FileUploadBean) aCommand;

if(bean.getFile == null)
{
//invalid path code
}

Curiously, a byte array instance is binded into the command class. Does anybody know why it is not null?

Thank you.
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the path from the command object, and what is your input?
 
Ronwaldo Cruz
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

There is no input. I just press the button without choosing a file but within the Controller the Command Class still has a byte array instance binded into it
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic