cancel
Showing results for 
Search instead for 
Did you mean: 

File Upload action is not called

Former Member
0 Kudos

I'm trying to upload file to a server and I use WDFileUpload UI control. After I select file on the client and click on 'Upload' button nothing happens. Action that assigned to that button is not called. But if FileUpload control is empty, file is not selected, action is called. Any ideas what I'm doing wrong?

Thanks,

Andrei

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I think it is a problem with the service Pack .it is working fine with SP10.Which Service Pack u are using?

Regards,

Sowjanya.

Answers (2)

Answers (2)

Former Member
0 Kudos

I was using SP9 and it didn't work. But after I deployed on SP11 it was ok.

Thanks.

Former Member
0 Kudos

Hi

Hope you mustve also created value attributes of type binary and string to be bound to the data and filename properties(of the Upload UI element) respectively.

In the 'onActionUpload'method specify the location where you want the file to be uploaded. On browsing, you get the file name in the value attribute assigned to the ‘filename’ property of FileUpload. This creates a file by this name in the sever. The contents of the file is present in the value attribute bound to data property. This is written to the file created. This happens when you click the ‘Upload’ button. The code for this is given below.

try

{

String location = "c:
"

String fileName = location + wdContext.currentFileElement().getFileName();

File file = new File(fileName);

FileOutputStream out = new FileOutputStream(file);

if(element.getUpload!=null)

{

out.write(element.getUpload());

out.close();

}

Here 'element' is an object of IFileElement(IPrivateFileUploadView.IFileElement element) 'Upload' is the value attribute bound to the 'data' property of the Upload UI Element.

Kindly revert back for further clarifications

Regards

Leena