
Brad McBride
Top achievements
Rank 1
Brad McBride
asked on 24 Sep 2010, 08:46 PM
I am creating an HTML editor using the RadEditor and I am running into an issue. I cannot upload files to the server that the control will be run on. Instead, when a user needs to add an image to an HTML page, they will need to reference a local file, i.e., <img src="file://c:/some_path/some_image.jpg />. Is there any way at all to use the image manager to look at files on the local computer and insert a reference to the local file instead of something on the remote server? If not, is there another way to easily do this?
5 Answers, 1 is accepted
0
Hi Brad,
When copying an image from external location such as your hard disk or desktop program as MS Word document or a PDF file, then the image src points to your hard disk, which is not accessible in Internet and the other network / internet users will be unable to see it.
In order to use images in a web page, they need to be accessible using HTTP protocol - that is, it means they must be uploaded to a web server (which can be your own computer of course, only that the images are provided by the web server software, and not by the operating system).
Unfortunately the automatic image upload to the server is not possible with JavaScript code, because JavaScript cannot access the local file system from the browser - it would be a major security violation.
The automatic image upload cannot be implemented without using ActiveX or another software, installed on the client. We do not use either technique because of browser compatibility and that the ActiveX components are forbidden by the corporate networks.
Best regards,
Rumen
the Telerik team
When copying an image from external location such as your hard disk or desktop program as MS Word document or a PDF file, then the image src points to your hard disk, which is not accessible in Internet and the other network / internet users will be unable to see it.
In order to use images in a web page, they need to be accessible using HTTP protocol - that is, it means they must be uploaded to a web server (which can be your own computer of course, only that the images are provided by the web server software, and not by the operating system).
Unfortunately the automatic image upload to the server is not possible with JavaScript code, because JavaScript cannot access the local file system from the browser - it would be a major security violation.
The automatic image upload cannot be implemented without using ActiveX or another software, installed on the client. We do not use either technique because of browser compatibility and that the ActiveX components are forbidden by the corporate networks.
Best regards,
Rumen
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

pavan
Top achievements
Rank 1
answered on 26 Sep 2011, 08:44 AM
So how to acheive this.Whether we have to upload that images to some server (through code)which is accessible to internet and then while showing we have to get it from the same server.or any other way?.What if we want to copy some images or graphics from local machine and then paste in radeditor(not browsing).Is this possible?
0
Hi Pavan,
As Rumen already explained, automatic upload of files cannot be achieve using JavaScript. Nevertheless, RadEditor's ImageManager offers upload functionality. If you do not have permissions to upload files to the server where the page resides you can assign a custom FTP content provider to the dialog to allow it to operate with a different FTP server where your users will have permissions to upload files. You can find an example of how to assign custom content provider to the ImageManager in the following live demo:
Editor / Custom File Dialogs Content Provider
Also, an example of FTPContentProvider is available in this KB article.
Greetings,
Dobromir
the Telerik team
As Rumen already explained, automatic upload of files cannot be achieve using JavaScript. Nevertheless, RadEditor's ImageManager offers upload functionality. If you do not have permissions to upload files to the server where the page resides you can assign a custom FTP content provider to the dialog to allow it to operate with a different FTP server where your users will have permissions to upload files. You can find an example of how to assign custom content provider to the ImageManager in the following live demo:
Editor / Custom File Dialogs Content Provider
Also, an example of FTPContentProvider is available in this KB article.
Greetings,
Dobromir
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0

pavan
Top achievements
Rank 1
answered on 27 Sep 2011, 02:27 PM
Thanks for your quick reply.But our requirement is just Copy Paste the images or any graphics to Radeditor from local harddisk.Is this acheivable
0
Hello Pavan,
Thanks for your quick reply.But our requirement is just Copy Paste the images or any graphics to Radeditor from local harddisk.Is this acheivable - No this is not achievable. Here is the detailed explanation of my colleague on the matter:
"When copying an image from external location such as your hard disk or desktop program as MS Word document or a PDF file, then the image src points to your hard disk, which is not accessible in Internet and the other network / internet users will be unable to see it.
In order to use images in a web page, they need to be accessible using HTTP protocol - that is, it means they must be uploaded to a web server (which can be your own computer of course, only that the images are provided by the web server software, and not by the operating system).
Unfortunately the automatic image upload to the server is not possible with JavaScript code, because JavaScript cannot access the local file system from the browser - it would be a major security violation.
The automatic image upload cannot be implemented without using ActiveX or another software, installed on the client. We do not use either technique because of browser compatibility and that the ActiveX components are forbidden by the corporate networks."
Greetings,
Stanimir
the Telerik team
Thanks for your quick reply.But our requirement is just Copy Paste the images or any graphics to Radeditor from local harddisk.Is this acheivable - No this is not achievable. Here is the detailed explanation of my colleague on the matter:
"When copying an image from external location such as your hard disk or desktop program as MS Word document or a PDF file, then the image src points to your hard disk, which is not accessible in Internet and the other network / internet users will be unable to see it.
In order to use images in a web page, they need to be accessible using HTTP protocol - that is, it means they must be uploaded to a web server (which can be your own computer of course, only that the images are provided by the web server software, and not by the operating system).
Unfortunately the automatic image upload to the server is not possible with JavaScript code, because JavaScript cannot access the local file system from the browser - it would be a major security violation.
The automatic image upload cannot be implemented without using ActiveX or another software, installed on the client. We do not use either technique because of browser compatibility and that the ActiveX components are forbidden by the corporate networks."
Greetings,
Stanimir
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now