[CLOSED] [#1385] [4.2.0] Upload component

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] [#1385] [4.2.0] Upload component

    Hi,

    it is possible to upload photos?
  2. #2
    Hello @ADV!

    You have the FileField component to handle file uploads. But I believe that specifically for photos, it would be a matter of your server settings allowing the file extension and possible sizes or not.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello,
    we are working with Web Forms.

    Can you show me an example page that uses EXT.NET Mobile and that allows to upload a file to chosen by the user?

    thank you.
  4. #4
    Hello @ADV!

    Here's an example using the FileField component to upload a file to the server:

    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                if (Request.Params["Photo"] != null)
                {
                    FeedbackBar.Call("setHtml", "Status: File uploaded: " + Request.Params["Photo"]);
                }
                else
                {
                    FeedbackBar.Call("setHtml", "Status: Waiting file to be selected.");
                }
            }
        }
    </script>
    
    <html>
    <head runat="server">
        <title></title>
        <script type="text/javascript">
            var handleSubmit = function (item, e) {
                var fileField = App.FileField1,
                    form = item.el.up('form').dom;
    
                if (fileField.getValue() == "") {
                    return false;
                } else {
                    form.submit();
                }
    
                return true;
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <ext:ResourceManager runat="server" />
    
                <ext:FileField ID="FileField1" runat="server" Name="Photo" Label="Choose a file to upload">
                    <Listeners>
                        <Change Handler="App.FeedbackBar.setHtml('Status: File selected. Ready to upload.');" />
                    </Listeners>
                </ext:FileField>
                <ext:Button runat="server" Text="Upload">
                    <Listeners>
                        <Tap Fn="handleSubmit" />
                    </Listeners>
                </ext:Button>
                <ext:Component ID="FeedbackBar" runat="server" />
            </div>
        </form>
    </body>
    </html>
    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Thank you,
    the server side I receive the file name.

    You can also also explain to me how I get the file to be saved?
  6. #6
    No answer for my question?

Similar Threads

  1. Replies: 2
    Last Post: Jun 27, 2013, 10:18 PM
  2. Replies: 8
    Last Post: Feb 06, 2013, 6:27 PM
  3. [CLOSED] Multiple file support to upload in file upload control
    By legaldiscovery in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 01, 2013, 9:41 AM
  4. Replies: 1
    Last Post: Jun 23, 2011, 9:37 AM
  5. Replies: 1
    Last Post: May 22, 2009, 7:38 AM

Posting Permissions