Skip to Content
author's profile photo Former Member
Former Member

File Upload action is not called

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 20, 2005 at 04:17 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 20, 2005 at 04:41 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 20, 2005 at 01:55 PM

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

    Thanks.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.