how to pass url to redupload upload handler
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
Hi Harish,
Which control you use for uploading? RadUpload for ASP.NET AJAX or RadUpload for Silverlight?
Best wishes,
Ivan Dimitrov
the Telerik team
I am using RedUpload for Ajax.
Harish
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
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.
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
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.