Number of uploaded files

Last post 12-17-2010, 12:10 PM by Eric. 5 replies.
Sort Posts: Previous Next
  •  12-15-2010, 9:23 AM 65373

    Number of uploaded files

    Hi there

    I'd like to know:

    1. How can I set that using upload control one can upload EXACTLY one picture? As I have to process picture and added info to database I need user to add ONE picture only, not 2 or 3 or more. I tried using MultipleFilesUpload=false but one can upload one and then another one and another one with the module. Should I use Manual start then?

    2. How can I set like 5 fields to upload? Now I have 5 upload fields (standard file fields and another extension to upload them) and 5 text fields with the space to put description to them. As I read I can not use the module nore than once. How can I then limit user to upload up to 5 pictures? Is there any option to limit? And secondly, how can I make description fields with them? As I found our your extension is a self sustaining module, how can I pass another field with it? Now user select picture using form upload button and write a desc in the text field. I have 5 upload and 5 desc fields and he can upload 5 pictures at a time. Using your module, how can I achieve that functionality?

    There seems to be a option: uploader.MaxFilesLimit=1 but it doesn't work, I can upload 5 files one by one :-(

    Thanx

    Your new customer Jerry ;-)

  •  12-16-2010, 1:54 AM 65378 in reply to 65373

    Re: Number of uploaded files

    Hi jerry2,
     
    question 1
     
    Please try the example below
     
     
    <%@  language="VBScript" %>
    <!-- #include file="aspuploader/include_aspuploader.asp" -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Form - Single File Upload </title>
        <link href="demo.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <div class="demo">
            <h2>
                Single File Upload</h2>
            <p>
                A basic sample demonstrating the use of the Upload control (Allowed file types:
                <span style="color: red">jpg, gif, png, zip</span>).</p>
            <%
                Dim uploader
                Set uploader=new AspUploader
                uploader.Name="myuploader"
                uploader.MaxFilesLimit=1
                uploader.MaxSizeKB=102
                uploader.InsertText="Upload File (Max 10M)"
                uploader.AllowedFileExtensions="*.jpg,*.png,*.gif,*.zip"
                uploader.SaveDirectory="savefiles"
                
                uploader.render()
            %>
            <br />
            <br />
            <input type="button" value="clear picture and enable upload again" onclick="enableUpload()" />

            <script type='text/javascript'>
         function CuteWebUI_AjaxUploader_OnPostback()
        {
            var hidden=this;
            hidden.internalobject.insertBtn.disabled='disabled';
         }
         function enableUpload()
         {
            var uploader = document.getElementById("myuploader");
            uploader.internalobject.insertBtn.disabled='';
            uploader.reset();
         }
            </script>

        </div>
    </body>
    </html>
     
     
    2. For now, asp uploader does not support multiple uploaders on the same page
     
    Regards,
     
    ken
     
     
     
  •  12-16-2010, 7:23 AM 65381 in reply to 65378

    Re: Number of uploaded files

    Hm, you are only disabling the button. I was looking for something like upload picture and show preview and upload again if you want. More like a Ajax-based-user-profile.aspx you have for Ajax Uploader. Minus the resize, I know ASP can not do that on it's own.

    About multiple uploader instances, that is really a great pity it is not working, would solve half my and I guess some other people also, problems. Is there any way to implement it, on PHP uploader I found in forum it works. And it was "just" a session issue, so perhaps you could make it work here. This way one could have your instance as form fileupload instance.

  •  12-16-2010, 8:39 PM 65395 in reply to 65381

    Re: Number of uploaded files

    Hi jerry2,
     
    Try the example below, in asp version there is not method the get the instance of the upload file, so you need to save it first.
     
     
    <%@  language="VBScript" %>
    <!-- #include file="aspuploader/include_aspuploader.asp" -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>example</title>
    </head>
    <body>
        <div>
            <img src="" id="image1" style="visibility: hidden" /><br />
            <%
                Dim uploader
                Set uploader=new AspUploader
                uploader.Name="myuploader"
                uploader.MaxFilesLimit=1
                uploader.MaxSizeKB=102
                uploader.InsertText="Upload File (Max 10M)"
                uploader.AllowedFileExtensions="*.jpg,*.png,*.gif,*.zip"
                uploader.SaveDirectory="savefiles"
                
                uploader.render()
            %>
            <br />
            <br />
            <input type="button" value="Save info" onclick="saveInfo()" />
             <script type='text/javascript'>
              var imageName;
            var uploader = document.getElementById("myuploader");
            uploader.handlequeueui = myqueueuihandler;

            function saveInfo() {

            }

            function CuteWebUI_AjaxUploader_OnSelect(files) {

                imageName = files[0].FileName;


            }

            function CuteWebUI_AjaxUploader_OnPostback() {

                var image1 = document.getElementById("image1");
                image1.style.visibility = "visible";
                image1.src = "savefiles/" + imageName;

            }

            function myqueueuihandler(list) {
                // hide the queue table
                return false;
            }
            </script>

        </div>
    </body>
    </html>

    Regards,
     
    Ken
  •  12-17-2010, 4:51 AM 65420 in reply to 65395

    Re: Number of uploaded files

    Is this demo for the multiple uploader instances or my first question?

    Sorry for so many questions I just bought this extension and I am trying to fit my work, after some time I'll not ask any more.

  •  12-17-2010, 12:10 PM 65428 in reply to 65420

    Re: Number of uploaded files

    Dear jerry2,
     
    This demo is for your first question.
     
    Thank you for asking
View as RSS news feed in XML