You must Sign In to post a response.
  • Category: ASP.NET

    File upload control - Telerik

    Hello.

    I have one web page with telerik "radasyncupload" control.
    In that, I have functionality of selection of image - Display to user - Save into database.

    Here while browse - File select, I need to display image to user without saving it into server.
    Because, if user doesn't want to save the file, the file keep as it is on server which creates junk files.

    Currently flow is working like, once user selects an image, it automatically save into server and then display to front end user, then user can decide he want to save it or not into database.

    So i want functionality like, when user selects an image, display it to user without saving. And when user click on save , then only save the file to actual server location.
    Anyone help me on this ???
  • #766945
    Hi

    try this code



    <telerik:RadAsyncUpload RenderMode="Lightweight" runat="server" CssClass="async-attachment" ID="AsyncUpload1"
    HideFileInput="true"
    AllowedFileExtensions=".jpeg,.jpg,.png,.doc,.docx,.xls,.xlsx" />
    <span class="allowed-attachments">Select files to upload <span class="allowed-attachments-list">(<%= String.Join( ",", AsyncUpload1.AllowedFileExtensions ) %>)</span>
    </span>




    you can refer this url


    "demos.telerik.com/aspnet-ajax/asyncupload/examples/large-file-uploads/defaultcs.aspx"
    "demos.telerik.com/aspnet-ajax/imageeditor/examples/imageupload/defaultcs.aspx?product=asyncupload"

    Name : Dotnet Developer-2015
    Email Id :kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #766960
    Hi,

    I'm not sure about telerik but as per my knowledge in ASP.net and your tag also set to ASP.net, I assume you are working in ASP.net web application project, so I given suggestion for the same,

    As you said when you browse the file itself you are saving the file in server and shows that to end user, now you want to change the logic, once click on save button you want to save into database/ server, in that case whatever the code part you wrote for saving the file into server cut the piece of code and create on more button name it as save and onclick of that button paste the copied content over there, if you still have a problem then place your piece of code for browse the file. So, that we can help you....

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #766967
    Hi,
    At Page_Load() event set RadAsyncUploadControl.TargetFolder = "desired folder";.
    Then call RadAsyncUpload_FileUploaded() event as OnFileUploaded="RadAsyncUploadControl_FileUploaded".
    Inside that event just write code to save file to specific folder as

    protected void RadAsyncUploadControl_FileUploaded(object sender, Telerik.Web.UI.FileUploadedEventArgs e)
    {
    e.File.SaveAs(RadAsyncUploadControl.TargetFolder + "\\"+ e.File.GetName());
    }

    After that inside btnSave_Click() event, write code to save file to DB.


Sign In to post your comments