0

I am running Windows Server 2012, IIS 8, and ASP.NET 4.5. Please be patient with me as I am new to both IIS and ASP.NET.

I am trying to build a site where users are able to upload multiple files which are placed into a folder hosted on the web server. When the user clicks the "Upload" button, I want that page to refresh and a message "Your file is successfully uploaded" is displayed.

Here is some code/pseudocode:

upload.aspx

<html>
    <head>
        <script language="Javascript">
            function validate() 
            {
                //does some validation stuff
                doUpload();
            }

            function doUpload() 
            {
                document.upload.todo.value="upload";
                document.upload.submit();
                //display message
            }
        </script>
    </head>

    <p name="message" style="display:hidden">File successfully uploaded.</p>

    <form method="post" action="upload.aspx" name="upload" enctype="multipart/form-data">
        <input type="file" name="uploadFile1">
        <input type="file" name="uploadFile2">
        <input type="file" name="uploadFile3">
        ...
        <input type="button" name="Submit" value="Upload" onClick="return validate()">
    </form>
</html>

The code does not place the files into a folder yet and I am not sure how to go about specifying that. Any help would be greatly appreciated!

0

1 Answer 1

1

You're going to struggle to do that with client side script.

This MSDN article explains the ASP.NET FileUpload control, have a read - http://msdn.microsoft.com/en-us/library/cc295177.aspx

Sign up to request clarification or add additional context in comments.

1 Comment

Okay, thanks. I'll look into the FileUpload control and the subsequent code-behind that is needed. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.