how to pass url to redupload upload handler

Posted by Community Admin on 03-Aug-2018 05:39

how to pass url to redupload upload handler

All Replies

Posted by Community Admin on 05-Aug-2011 00:00

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

Posted by Community Admin on 05-Aug-2011 00:00

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

Posted by Community Admin on 05-Aug-2011 00:00

I am using RedUpload for Ajax.


Harish

Posted by Community Admin on 05-Aug-2011 00:00

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

Posted by Community Admin on 05-Aug-2011 00:00

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.

Posted by Community Admin on 05-Aug-2011 00:00

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

Posted by Community Admin on 05-Aug-2011 00:00

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

This thread is closed