Re: uploading a .xls file

2009-09-10 Thread KIRTI CHOPRA

Thank you so much for the help!!!
-- 
View this message in context: 
http://www.nabble.com/uploading-a-.xls-file-tp25377242p25383919.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: uploading a .xls file

2009-09-10 Thread Bill Bohnenberger
Write code in your action class to copy the temp file. You'll have to
respect your application server's containment rules: I simply copy the file
to a permanent place in my application context.

On Thu, Sep 10, 2009 at 12:59 AM, KIRTI CHOPRA wrote:

>
> Thank you so much but  can you please tell me how can i save the uploaded
> file
> --
> View this message in context:
> http://www.nabble.com/uploading-a-.xls-file-tp25377242p25378975.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: uploading a .xls file

2009-09-10 Thread KIRTI CHOPRA

Thank you so much but  can you please tell me how can i save the uploaded
file
-- 
View this message in context: 
http://www.nabble.com/uploading-a-.xls-file-tp25377242p25378975.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: uploading a .xls file

2009-09-09 Thread Bill Bohnenberger
if you use name="file" in the  tag, your variable names should be
"file", "fileFileName" and "fileContentType"

- Bill

On Wed, Sep 9, 2009 at 10:45 PM, KIRTI CHOPRA wrote:

>
> hi
> but does it make any difference it is just variable name if i am not wrong
> but i am not sure about it also
> please let me know if it makes any difference.
>
> Thanks!!!
> --
> View this message in context:
> http://www.nabble.com/uploading-a-.xls-file-tp25377242p25377629.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: uploading a .xls file

2009-09-09 Thread KIRTI CHOPRA

hi
but does it make any difference it is just variable name if i am not wrong
but i am not sure about it also
please let me know if it makes any difference.

Thanks!!!
-- 
View this message in context: 
http://www.nabble.com/uploading-a-.xls-file-tp25377242p25377629.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: uploading a .xls file

2009-09-09 Thread Steven Yang
are u getting anything from the uploadContent?
because i think i should be

File file
String fileContentType
String fileFileName

On Thu, Sep 10, 2009 at 12:50 PM, KIRTI CHOPRA wrote:

>
> hi all
> i am new to struts and trying to upload a file in struts 2.0
> i am using  tag and have given simple getter setters in action
> class
> i am getting null value in file name pls help and let me know how i can do
> it.
> code is given below:
> Action class
>
> package com.neevtech.newsletter.action;
>
>  import java.io.File;
>
> /**
>  * Created by IntelliJ IDEA.
>  * User: Owner
>  * Date: Sep 9, 2009
>  * Time: 10:22:18 AM
>  * To change this template use File | Settings | File Templates.
>  */
> public class UploadXlsAction extends BaseAction {
>private File file;
>private String uploadContent;
>private String fileName;
>
>public String execute() throws Exception
>{
>this.file=getFile();
>this.fileName=getFileName();
>/*String filepath=file.getAbsolutePath();
>System.out.println(filepath);*/
>System.out.println(fileName);
>return "success";
>}
>public File getFile() {
>return file;
>}
>
>public void setFile(File file) {
>this.file = file;
>}
>
>public String getUploadContent() {
>return uploadContent;
>}
>
>public void setUploadContent(String uploadContent) {
>this.uploadContent = uploadContent;
>}
>
>public String getFileName() {
>return fileName;
>}
>
>public void setFileName(String fileName) {
>this.fileName = fileName;
>System.out.println(fileName);
>}
>
>public String uploaded(){
>this.file=getFile();
>this.fileName=getFileName();
> System.out.println(fileName);
>return "success";
>}
>
> }
> Jsp page
>
> <%@ taglib prefix="s" uri="/struts-tags"%>
> <%@ taglib uri="http://java.sun.com/jstl/core"; prefix="c"%>
>
>
> 
>
>
> theme="simple">
>
>
>
>        
>
>
> 
>  label="upload xls" align="left" cssStyle="margin-left:100px;"/>
> 
>
>
>
> 
>
> --
> View this message in context:
> http://www.nabble.com/uploading-a-.xls-file-tp25377242p25377242.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


uploading a .xls file

2009-09-09 Thread KIRTI CHOPRA

hi all
i am new to struts and trying to upload a file in struts 2.0
i am using  tag and have given simple getter setters in action class
i am getting null value in file name pls help and let me know how i can do
it.
code is given below:
Action class

package com.neevtech.newsletter.action;

 import java.io.File;

/**
 * Created by IntelliJ IDEA.
 * User: Owner
 * Date: Sep 9, 2009
 * Time: 10:22:18 AM
 * To change this template use File | Settings | File Templates.
 */
public class UploadXlsAction extends BaseAction {
private File file;
private String uploadContent;
private String fileName;

public String execute() throws Exception
{
this.file=getFile();
this.fileName=getFileName();
/*String filepath=file.getAbsolutePath();
System.out.println(filepath);*/
System.out.println(fileName);
return "success";
}
public File getFile() {
return file;
}

public void setFile(File file) {
this.file = file;
}

public String getUploadContent() {
return uploadContent;
}

public void setUploadContent(String uploadContent) {
this.uploadContent = uploadContent;
}

public String getFileName() {
return fileName;
}

public void setFileName(String fileName) {
this.fileName = fileName;
System.out.println(fileName);
}

public String uploaded(){
this.file=getFile();
this.fileName=getFileName();
 System.out.println(fileName);
return "success";
}

}
Jsp page

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.sun.com/jstl/core"; prefix="c"%>












 
 
 


    


-- 
View this message in context: 
http://www.nabble.com/uploading-a-.xls-file-tp25377242p25377242.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org