1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / how to pass url to redupload upload handler

how to pass url to redupload upload handler

7 posts, 0 answered
  1. Hari
    Hari avatar
    9 posts
    Registered:
    18 May 2011
    05 Aug 2011
    Link to this post
    hi,,


    i am trying to pass web url to the upload handler ... but i dont know . how to do this ...
    can anyone help me out on thsi ... and please tell me how to handle proxies during passing url to handler...


    Thanks,
    Harish
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    05 Aug 2011
    Link to this post
    Hi Harish,

    Which control you use for uploading? RadUpload for ASP.NET AJAX or RadUpload for Silverlight?

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Hari
    Hari avatar
    9 posts
    Registered:
    18 May 2011
    05 Aug 2011
    Link to this post
    I am using RedUpload for Ajax.


    Harish
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    05 Aug 2011
    Link to this post
    Hello Harish,

    The RadAsyncUpload handler accepts only files not urls. What is the desired result that you want to achieve, because currently passing the url to the handler does not make sense in the context of the handler which purpose is different.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Hari
    Hari avatar
    9 posts
    Registered:
    18 May 2011
    05 Aug 2011
    Link to this post
    Actually i want to pass the web url of the image to the handler which is somewhere in the remote server .. and wants that handler will upload it to the sitefinity library and will return the sitefinity image url with ashx format.


    Harish.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    05 Aug 2011
    Link to this post
    Hi Harish,

    We do not support this functionality out of the box. This will require to create a custom control where you pass the url, then you get the file  as byte[], store it locally as a temp and then upload the file to Sitefinity.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Hari
    Hari avatar
    9 posts
    Registered:
    18 May 2011
    05 Aug 2011
    Link to this post
    hi,

    this is the way i am approaching ....


    string imagepath = "http://imageurl";

    SiteLibrary.ImageClass pp = new SiteLibrary.ImageClass();

    StreamWriter strwr = new StreamWriter("d:\\stream.txt");

    strwr.WriteLine(pp.GetImageUrl(imagepath,"Collections"));

    strwr.Close();

    -------------------------------------------------------------------------------------

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using System;

    using System.Data;

    using System.Configuration;

    using System.Collections;

    using System.Web;

    using System.Web.Security;

    using System.Web.UI;

    using System.Web.UI.WebControls;

    using System.Web.UI.WebControls.WebParts;

    using System.Web.UI.HtmlControls;

    using System.ComponentModel;

    using System.Drawing;

    using log4net;

    using System.Net;

    using Telerik;

    using Telerik.Cms;

    using Telerik.Cms.Web;

    using Telerik.Web.UI;

    using Telerik.Caching;

    using Telerik.Cms.Web.UI;

    using System.IO;

     

    namespace SiteLibrary

    {

    public class ImageClass

    {

    public string GetImageUrl(string fileUrl, string libName)

    {

    Telerik.Libraries.LibraryManager libraryManager = new Telerik.Libraries.LibraryManager();

    Telerik.Libraries.ILibrary parentLibrary = libraryManager.GetLibrary(libName);


    WebClient
    urlGrabber = new WebClient();

    byte[] bytes = urlGrabber.DownloadData(fileUrl);

     

    try

    {

    content = libraryManager.UploadFile(bytes,

    "filename",

    "jpeg",

    "image/jpeg",

    bytes.Length,

    parentLibrary);

    }

    catch (ArgumentException ex)

    {

    AppLog.Write("", AppLog.LogMessageType.Error, ex, this.GetType());

    }

    return content.UrlWithExtension;

     

    }

     

    }

    }

    ------------------------------------------------------------------------------------------------------------------------------------

    Is it the correct way to approach?.. because it is working fine but only problem is with the proxy authenticate.
    Please tell me how can i handle the proxy ... i want to pass USER-ID and PASSWORD for the proxy authenticate


    Thanks,
    Harish
7 posts, 0 answered