[Cartoweb-users] Upload georeferenced images with Edition plugin

Oliver Christen oliver.christen at camptocamp.com
Wed Jun 20 02:23:34 EDT 2007


Hi Igor

The error you get seem to come from a javascript security violation.
Line 561 is when you set sbm1.value="userfile";
But why are your trying to set a value to the file input ?
As far as I know you are not allowed to set a file value via javascript, 
only a user can select manualy a file.

I suggest you try make your file upload formular works as a stand alone 
application (outside of cartoweb).

Once it works, you can call it from a link that would be generated in the 
dhtmlEdit.js.
To performe javascript action between the popup and the "parent" window, you 
simply have to give a name to the popup when creating it.
Have a look at 
http://www.javascript-coder.com/window-popup/javascript-window-open.phtml
Here is an example:
mywindow = window.open 
("http://www.foo.com","mywindow","location=1,status=1,scrollbars=1,width=100,height=100");
>From the popup you can access (call functions) the parent by using 
windows.opener, see http://www.webreference.com/js/tutorial1/opener.html for 
more infos.

There are plenty of tutorial on the web about file upload and javascript 
popup handling, you shouldnt have much problem to do what you want.

regards
Oliver

----- Original Message ----- 
From: "Игорь Евдокимов" <igev at mail.ru>
To: "Oliver Christen" <oliver.christen at camptocamp.com>
Cc: <cartoweb-users at lists.maptools.org>
Sent: Wednesday, June 20, 2007 2:28 AM
Subject: Re: [Cartoweb-users] Upload georeferenced images with Edition 
plugin


> Hi, Oliver!
>
> Correction - message with attachment.
>
>> Im not sure why you get an error, maybe if you tell me which error
>> message you get exactly ?
>
> I made some changes in dhtmlEdit.js (strings 548-575) -see attachment.
>
>


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


>
>
> And I receive this message when I try to add new point on map:
>
> Error: [Exception... "Security error"  code: "1000" nsresult:
> "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)"  location: "http://
> imac.local/cartoweb/htdocs/terraphoto/edit/js/dhtmlEdit.js Line: 561"]
> Source: http://imac.local/cartoweb/htdocs/terraphoto/edit/js/
> dhtmlEdit.js
> String: 561
>
>
>> I think this would be easier to do in a popup than directly within
>> the edition javascript.
>> Maybe simply add a link in the edition javascript that would open
>> the popup, that would prevent getting weird side effect because of
>> the complexity of the edition javascript. Thats just an idea.
>
> 1. I think I must place only one button near my "field with file
> attachment" to call a popup.
> 2. This popup must do uploading of file and generating its new name.
> 3. This popup, when closed, must return new filename to main form of
> "edition plugin" - with editable fields.
> Is it possible?
>
> Also, I think, "edition plugin" must have this "attachment feature" -
> attachments can be not only IMAGES, but any data
> (scientific, geological, etc).
>
> Thank You for your answer.
>
> Best regards, Igor.
>
> 



More information about the Cartoweb-users mailing list