[kupu-dev] Paste image from msword

Duncan Booth duncan.booth at suttoncourtenay.org.uk
Fri Mar 2 16:23:23 CET 2007


"Diego Municio" <dmunicio at gmail.com> wrote:

> But I would like to know your opinion about this workaround:
> 
> It's clear that an upload is currenly working.
> I would create a <form> which gets filled with all src's from <img
> src="file:\\\..."> tags pasted
> Add an onpaste event which calls:
> - my fill_form function
> - my_form.submit
> - and fixes srcs in <img src> tags to point to the new plone images.
> 
> I am not a javascript guru, but I don't see it impossible so please
> correct me if I am saying nonsenses
> before I started to write code.
> 
> I think that it would be a nice feature!

If I understand you correctly, you want Kupu to create a form with image 
upload controls for all the images with file:// urls and upload those 
images to the server then fix the URLs in the document?

If Kupu could do that then any website you visited could upload any 
arbitrary files from your hard disc, so say goodbye to your bank account 
details. Fortunately the only way to upload a file is for the user to 
select the file into a file upload control. There is no way to automate 
that process.

What would be doable would be for kupu to refuse to save the edited 
document if it contains any file:// urls. It could maybe even create a 
form as you suggest with the file:// urls extracted from the document 
displayed and a file upload box for each of them. The user would then 
have to make each upload control match the displayed url manually.



More information about the kupu-dev mailing list