Re: [WebDNA] Froala Editor working with WebDNA
This WebDNA talk-list message is from 2016
It keeps the original formatting.
numero = 113284
interpreted = N
texte = 872This is better:[!]HAS_WEBDNA_TAGS[/!]Regards,Kenneth GromeWebDNA Solutionshttp://www.webdnasolutions.comWeb Database Systems and Linux Server AdministrationOn 12/28/2016 06:06 AM, Christer Olsson wrote:> You can put [/SHOWIF]>=20> Best,> Christer>=20> *************************************************************> Christer Olsson PO Box 9160 Phone +46 40 25 85 85> Ljusa Id=C3=A9er AB SE-200 39 Malmo Fax +46 40 25 85 89> Kantyxegatan 5 Sweden http://www.ljusaideer.se>=20>=20>> 28 dec. 2016 kl. 12:57 skrev Palle Bo Nielsen>>
>:>>>> Hi Stuart>>>> I had a conversation with the guys behind the Froala framework>> and it seems like the missing linking this algorithm is the fact>> that the JSON output *must=E2=80=99 stand alone, than being without an=y>> HTML og Tags of any kind in the HTML source.>>>> So basically this JSON was correct, but it MUST be the only>> output to the browser. So now the question is, how to make this>> happen without to popular the [VA=R_INDEX]>> and without tags of any kind. I would like to avoid>> having =E2=80=9Calways interpret an html page with webdna=E2=80=9D ena=bled.>>>> { link:>> 'http://qt.dk/dev/froala/image/inspirations/[VAR_INDEX].jpg' }>>>> /Palle>>>>>>>>>>>>>>>> On 27 Dec 2016, at 22.04, Stuart Tremain >>> > wrote:>>>>>>>> Try this, also you had a curly =E2=80=98 after .jpg>>>>>>>>>>>>>>>> [TEXT]VAR_INDEX=3D[format 10.0f][cart][/format][/TEXT][!]>>>> [/!][TEXT]SHORTPATH=3D/dev/froala/image/inspirations[/TEXT][!]>>>>>>>> [/!][FORMVARIABLES][!]>>>> [/!][showif [name]^file_name][!]>>>> [/!][WRITEFILE>>>> Secure=3DF&File=3D[SHORTPATH]/[VAR_INDEX].jpg][value][/WRITEFILE][!]>>>> [/!][/showif][!]>>>> [/!][/FORMVARIABLES][!]>>>>>>>> [/!]{ link:>>>> 'http://qt.dk/dev/froala/image/inspirations/[VAR_INDEX].jpg' }>>>>>>>>>>>>>>>>>>>>>>>> Kind regards>>>>>>>> Stuart Tremain>>>> Pharoah Lane Software>>>> AUSTRALIA>>>> webdna@idfk.com.au >>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 28 Dec 2016, at 07:57, Palle Bo Nielsen>>>>> >>>>>> wrote:>>>>>>>>>> Evening Stuart>>>>>>>>>> So I truncated your original code a bit to make it less>>>>> complex in this Proof of Concept setup.>>>>>>>>>> As you can see when you visit the page>>>>> (qt.dk/dev/froala/image/ ) ->>>>> you are able to drag and drop an image to the Froala textarea>>>>> field and the image is showing in the same field.>>>>>>>>>> The actual image is matched by the server and saved on the>>>>> server and a JSON is produced but probably not coached by the>>>>> Froala framework as the image has a error text below the>>>>> image and the image disappears when clicking in the textarea>>>>> field.>>>>>>>>>> When you state that =E2=80=9C...Make sure that there is nothing abo=ve>>>>> or below this response as JSON is sensitive=E2=80=A6=E2=80=9D do yo=u then>>>>> indicate that the output in the browser is not even allowed>>>>> to include normal html tags like =E2=80=9Chtml, head, body, etc.=E2==80=9D ?=20>>>>>>>>>> My truncated code below:>>>>>>>>>> [TEXT]VAR_INDEX=3D[format 10.0f][cart][/format][/TEXT]>>>>> [TEXT]SHORTPATH=3D/dev/froala/image/inspirations[/TEXT]>>>>>>>>>> [FORMVARIABLES]>>>>> [showif [name]^file_name]>>>>> [WRITEFILE>>>>> Secure=3DF&File=3D[SHORTPATH]/[VAR_INDEX].jpg][value][/WRITEFILE]>>>>> [/showif]>>>>> [/FORMVARIABLES]>>>>>>>>>> { link:>>>>> 'http://qt.dk/dev/froala/image/inspirations/[VAR_INDEX].jpg=E2=80=99>>>>> >>>>> }>>>>>>>>>> /Palle>>>>>>>>>>>>>>>> On 27 Dec 2016, at 17.49, Stuart Tremain >>>>> > wrote:>>>>>>>>>>>> Hi Palle>>>>>>>>>>>> Merry Christmas.>>>>>>>>>>>> According to the Froala docs:>>>>>>>>>>>> https://froala.com/wysiwyg-editor/docs/concepts/image/upload>>>>>>>>>>>> =E2=80=9C4. The server processes the HTTP request.>>>>>> The server has to process the upload request, save the image>>>>>> and return a JSON containing a link to the uploaded image.>>>>>> The returned JSON needs to look like: { link:>>>>>> 'path/to/image.jpg=E2=80=99 }=E2=80=9D>>>>>>>>>>>> or if there is an error return {error: 'error message'}>>>>>>>>>>>> Make sure that there is nothing above or below this response>>>>>> as JSON is sensitive to have any other =E2=80=9Cclutter=E2=80=9D i=n the>>>>>> response, you will notice that in my code all line breaks>>>>>> etc are commented so that the only visible code in a>>>>>> rendered page is:>>>>>> { "filelink":>>>>>> "http://assets.mydomain.com.au/inspirations/[THISIMAGENAME]=E2=80=9D= }>>>>>>>>>>>> JSON is case sensitive.>>>>>>>>>>>>>>>>>>>>>>>> Kind regards>>>>>>>>>>>> Stuart Tremain>>>>>> Pharoah Lane Software>>>>>> AUSTRALIA>>>>>> webdna@idfk.com.au >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 28 Dec 2016, at 01:14, Palle Bo Nielsen>>>>>>> >>>>>> > wrote:>>>>>>>>>>>>>> Hi Stuart>>>>>>>>>>>>>> Thanks for pushing me in the right direction.>>>>>>>>>>>>>> By using fragments of your code I have managed to actually>>>>>>> catch the image and store it locally. My next challenge>>>>>>> would be to reply with a JSON, which you so accurately>>>>>>> guessed in your response to me.>>>>>>>>>>>>>> I would guess that your are delivering your Redactor>>>>>>> feedback using the code below, but (novice as I am using>>>>>>> JSON) it does not look like a JSO string to me=E2=80=A6>>>>>>>>>>>>>> -------------- TELL REDACTOR THE FILE NAME --------------=20>>>>>>> { "filelink":>>>>>>> "http://assets.mydomain.com.au/inspirations/[THISIMAGENAME]=E2=80==9D }>>>>>>>>>>>>>> Are you actually telling my that the response to Froala>>>>>>> could be as simple as =E2=80=98printing=E2=80=99 something like t=his=E2=80=A6??>>>>>>>>>>>>>> http://qt.dk/dev/froala/image/inspirations/**the_file_name**>>>>>>>>>>>>>> /Palle>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 20 Dec 2016, at 05.13, Stuart Tremain>>>>>>>> > wrote:>>>>>>>>>>>>>>>> Hi Palle>>>>>>>>>>>>>>>> I had a look at your test page and dragged an image into>>>>>>>> the text area.>>>>>>>>>>>>>>>> Immediately after dragging the image an XHR fired up>>>>>>>> (https://www.dropbox.com/s/yfdiqsw3vravfv8/Screen%20Shot%202016-=12-20%20at%2015.07.25.png?dl=3D0).>>>>>>>> This is where you need to have a WebDNA page to capture>>>>>>>> and save the image.>>>>>>>>>>>>>>>> I am using a similar system called Redactor to drag & drop>>>>>>>> images to a text area>>>>>>>> (https://www.dropbox.com/s/n7hfeemss2w4i0j/Screen%20Shot%202016-=12-20%20at%2015.07.08.png?dl=3D0),>>>>>>>> you can see the XHR image-s1.dna file that fired when I>>>>>>>> dropped the image in the text area.>>>>>>>>>>>>>>>> The image-s1.dna file captures the image, uses imagemagick>>>>>>>> to resize it, then moves the image to an Amazon S3 server,>>>>>>>> deletes the uploaded image and sends back to redactor JSON>>>>>>>> data about the file.>>>>>>>>>>>>>>>> It looks as if you do not have a file to capture the image>>>>>>>> data.>>>>>>>>>>>>>>>> On line 447 of your rendered code you will find this:>>>>>>>>>>>>>>>>>>>>>>>> // Set the image upload URL.>>>>>>>> imageUploadURL: '/dev/froala/image=E2=80=99,>>>>>>>>>>>>>>>> What you need to do is put a WebDNA file at that location>>>>>>>> to capture the file & store it. So set an upload url e.g.:=20>>>>>>>>>>>>>>>> // Set the image upload URL.>>>>>>>> imageUploadURL: '/dev/froala/image/image-capture.dna=E2=80=99,>>>>>>>>>>>>>>>> In image-capture.dna put>>>>>>>>>>>>>>>> [formvariables][name]:[value]>>>>>>>> [/formvariables]>>>>>>>>>>>>>>>> in the page. You will be able to see what data is being>>>>>>>> passed, then you just need to handle the data and save the>>>>>>>> file. I would presume that Froala will require a response,>>>>>>>> probably JSON formatted.>>>>>>>>>>>>>>>>>>>>>>>> Here is the contents of my image-s1.dna file: PLEASE NOTE>>>>>>>> THAT THIS SITE IS IN A SANDBOX>>>>>>>>>>>>>>>> #####################################################>>>>>>>> [!] -------------- _IMAGE START --------------=20>>>>>>>> [/!][TEXT]IMAGEFILENAME=3D[/TEXT][!]>>>>>>>> [/!][TEXT]CELLSIZE=3D118[/TEXT][!]>>>>>>>> [/!][TEXT]SHORTPATH=3D../../../imageprocessing/inspirations[/TEX=T][!]>>>>>>>> [/!][TEXT]LONGPATH=3D/var/www/imageprocessing/inspirations[/TEXT=][!]>>>>>>>> [/!][FORMVARIABLES name=3DFILE&exact=3DF][!]>>>>>>>> [/!][HIDEIF [URL][value][/URL]=3D][!]>>>>>>>> [/!][SHOWIF [url][name][/url]^[url]name=3D"[/url]][!]>>>>>>>> [/!][HIDEIF [url][name][/url]^[url]filename=3D"[/url]][TEXT>>>>>>>> show=3DT][MIDDLE>>>>>>>> StartAfter=3Dname=3D"&endbefore=3D"][name][/MIDDLE]=3D[value][/T=EXT][/HIDEIF][!]>>>>>>>> [/!][/SHOWIF][!]>>>>>>>> [/!][SHOWIF [url][name][/url]^[url]filename=3D"[/url]][!]>>>>>>>> [/!][TEXT]FULLFILENAME=3D[MIDDLE>>>>>>>> StartAfter=3Dfilename=3D"&endbefore=3D"][name][/MIDDLE][/TEXT][!=]>>>>>>>> [/!][listwords>>>>>>>> words=3D[FULLFILENAME]&delimiters=3D:/\][TEXT]THISIMAGENAME=3D[M=ATH]{[date]}[/MATH][MATH]{[time]}[/MATH]-[LOWERCASE][convertchars>>>>>>>> db=3D^noillegals.db][word][/convertchars][/LOWERCASE][/TEXT][/li=stwords][!]>>>>>>>> -------------- write the file to upload dir -------------->>>>>>>> [/!][HIDEIF [FULLFILENAME]=3D][!]>>>>>>>> ------------------- IMAGEMAGICK ----------------->>>>>>>> [/!][WRITEFILE>>>>>>>> Secure=3DF&File=3D[SHORTPATH]/[THISIMAGENAME]][value][/WRITEFILE=][!]>>>>>>>> [/!][TEXT]IMAGEWIDTH=3D[CELLSIZE][/TEXT][!]>>>>>>>> [/!][TEXT]IMAGEHEIGHT=3D[CELLSIZE][/TEXT][!]>>>>>>>> [/!][TEXT]IMAGEQUALITY=3D80[/TEXT][!]>>>>>>>> [/!][TEXT]IMAGESWITCH=3D![/TEXT][!] ! =3D exactly this size=20>>>>>>>> [/!][TEXT]IMAGEPATH=3D[LONGPATH][/TEXT][!]>>>>>>>> [/!][TEXT]IMAGEFILENAME=3D[THISIMAGENAME][/TEXT][!]>>>>>>>> [/!][TEXT]QUIET=3D[SHELL>>>>>>>> scriptid=3DT3IMAGERESIZE][/SHELL][/TEXT][!]>>>>>>>> ------------------- MOVE THE IMAGES TO S3 ----------------->>>>>>>> [/!][LISTFILES path=3D[SHORTPATH]/][!]>>>>>>>> [/!][TEXT]THISS3CMD=3Ds3cmd put --acl-public>>>>>>>> /var/www/imageprocessing/inspirations/[FILENAME]>>>>>>>> s3://assets.mydomain.com.au/inspirations/>>>>>>>> --add-header=3DCache-Control:max-age=3D2592000>>>>>>>> --config=3D/usr/lib/cgi-bin/WebCatalogEngine/SandBoxes/MYSANDBOX=/Globals/.awards-s3cfg[/TEXT][!]>>>>>>>> [/!][TEXT]QUIET=3D[SHELL scriptid=3DAWSS3][/SHELL][/TEXT][!]>>>>>>>> [/!][/LISTFILES][!]>>>>>>>>>>>>>>>> ------------------- REMOVE ALL FILES FROM ORIGINALS/THUMBS>>>>>>>> etc ----------------->>>>>>>> [/!][LISTFILES path=3D[SHORTPATH]/][DELETEFILE>>>>>>>> file=3D[SHORTPATH]/[FILENAME]][/LISTFILES][!]>>>>>>>> [/!][/HIDEIF][!]>>>>>>>> [/!][/SHOWIF][!]>>>>>>>> [/!][/HIDEIF][!]>>>>>>>> [/!][/FORMVARIABLES][!]=20>>>>>>>> -------------- TELL REDACTOR THE FILE NAME --------------=20>>>>>>>> [/!]{ "filelink":>>>>>>>> "http://assets.mydomain.com.au/inspirations/[THISIMAGENAME]=E2=80==9D }>>>>>>>> #####################################################>>>>>>>>>>>>>>>>>>>>>>>> Kind regards>>>>>>>>>>>>>>>> Stuart Tremain>>>>>>>> Pharoah Lane Software>>>>>>>> AUSTRALIA>>>>>>>> webdna@idfk.com.au >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 18 Dec 2016, at 00:29, Palle Bo Nielsen>>>>>>>>> >>>>>>>> > wrote:>>>>>>>>>>>>>>>>>> Hi Stuaty>>>>>>>>>>>>>>>>>> Thanks for your interest.>>>>>>>>>>>>>>>>>> Ok, let me repeat the baseline just make sure we do not>>>>>>>>> misunderstand the setup.>>>>>>>>>>>>>>>>>> I have made test page which uses the Froala framework>>>>>>>>> with the aim of using the function of drag=E2=80=99n=E2=80=99dr=op and>>>>>>>>> image into the TextArea field, only to be catched/saved>>>>>>>>> Server Side and presented Client Side as per the concept>>>>>>>>> of Froala. I need this solution on my next website which>>>>>>>>> is currently under development. So basically WebDNA as>>>>>>>>> Server Side and Froala as Client Side.>>>>>>>>>>>>>>>>>> You will find my test set up at the follow URL (id: a ->>>>>>>>> pswd: a)>>>>>>>>>>>>>>>>>> http://qt.dk/dev/froala/image/>>>>>>>>>>>>>>>>>> Information about the Froala client is here (wysiwyg html>>>>>>>>> editor)>>>>>>>>>>>>>>>>>> https://www.froala.com/wysiwyg-editor/>>>>>>>>>>>>>>>>>> But more important. Information about the Image>>>>>>>>> drag=E2=80=99n=E2=80=99drop into Textarea her=E2=80=A6>>>>>>>>>>>>>>>>>> https://www.froala.com/wysiwyg-editor/docs/concepts/image/uploa=d>>>>>>>>>>>>>>>>>> You suggested to include a [FormVariables =E2=80=A6] on the pag=e.>>>>>>>>> I already did and therefor you can already find debug>>>>>>>>> information at the bottom of the page (qt.dk>>>>>>>>> =E2=80=A6)>>>>>>>>>>>>>>>>>> So the actual Froala Framework is setup and it works. M=C3=BD>>>>>>>>> challenge is to get the drag=E2=80=99ndrop image into textarea =to>>>>>>>>> work. I am not sure how to catch the file from the Froala>>>>>>>>> framework to start with. Maybe I already did but again>>>>>>>>> then I do not know how to store it (save) server side.>>>>>>>>>>>>>>>>>> I would really appreciate some guidance to get this>>>>>>>>> working and I will make sure the final result will be>>>>>>>>> shared within the webdna community as well as webdna.us>>>>>>>>> and froala.com .>>>>>>>>>>>>>>>>>> You also mention that =E2=80=9C...From what I see in the script=,>>>>>>>>> the receiving url for the file is: imageUploadURL:>>>>>>>>> '/upload_image=E2=80=99, =E2=80=A6=E2=80=9D. You might look at =the wrong place as>>>>>>>>> the ImageUploadUrl is: "/dev/froala/image">>>>>>>>>>>>>>>>>> /Palle>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 15 Dec 2016, at 23.15, Stuart Tremain>>>>>>>>>> > wrote:>>>>>>>>>>>>>>>>>>>> Hi Palle>>>>>>>>>>>>>>>>>>>> Thanks for the link, now I can see what is going on.>>>>>>>>>>>>>>>>>>>> From what I see in the script, the receiving url for the>>>>>>>>>> file is:>>>>>>>>>>>>>>>>>>>> // Set the image upload URL.>>>>>>>>>>>>>>>>>>>> imageUploadURL>>>>>>>>>> : '/upload_image',>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> If you put [FormVariables>>>>>>>>>> name=3D&exact=3DF][name]=3D[value]
[/FormVariables] on this>>>>>>>>>> page and then post the results, I will be able to see>>>>>>>>>> what is going on, you can do this by looking at the XHRs>>>>>>>>>> results in your browser.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Kind regards>>>>>>>>>>>>>>>>>>>> Stuart Tremain>>>>>>>>>> Pharoah Lane Software>>>>>>>>>> AUSTRALIA>>>>>>>>>> webdna@idfk.com.au >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 16 Dec 2016, at 07:25, Palle Bo Nielsen>>>>>>>>>>> >>>>>>>>>> > wrote:>>>>>>>>>>>>>>>>>>>>>> Hi Stuart>>>>>>>>>>>>>>>>>>>>>> Please stop me if am using to much of your time, but=E2=80=A6>>>>>>>>>>>>>>>>>>>>>> First of all. If I understand your code correctly then>>>>>>>>>>> it assumes that a formvariable exist by the name of>>>>>>>>>>> <=E2=80=9C_UPLOADEDFILENAME=E2=80=9D> (your example), in my c=ase it>>>>>>>>>>> should be <=E2=80=9Cfile_name=E2=80=9D> hence the =E2=80=98im=ageUploadParam=E2=80=99>>>>>>>>>>> which is set in the JS code.>>>>>>>>>>>>>>>>>>>>>> https://www.froala.com/wysiwyg-editor/docs/concepts/image/upl=oad>>>>>>>>>>>>>>>>>>>>>> But the [formvariables=E2=80=A6] does not result in any>>>>>>>>>>> variable by that name or any other which is relevant>>>>>>>>>>> for this proces which leaves me in a situation where I>>>>>>>>>>> have nothing to catch from the JS/Image File supposedly>>>>>>>>>>> being uploaded.>>>>>>>>>>>>>>>>>>>>>> I think I understand the rest of the code but it is a>>>>>>>>>>> prerequisite than the formvariable is being identified>>>>>>>>>>> and catched, right?>>>>>>>>>>>>>>>>>>>>>> /Palle>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 14 Dec 2016, at 21.52, Stuart Tremain>>>>>>>>>>>> > wrote:>>>>>>>>>>>>>>>>>>>>>>>> Hi Palle>>>>>>>>>>>>>>>>>>>>>>>> You will find that the file is being uploaded in a>>>>>>>>>>>> multipart/form-data form, therefore you need to deal>>>>>>>>>>>> with the contents in a different way rather than as>>>>>>>>>>>> name valued pairs.>>>>>>>>>>>>>>>>>>>>>>>> Try this to capture the file name and it=E2=80=99s contents,= I>>>>>>>>>>>> have pulled it out of some working code:>>>>>>>>>>>>>>>>>>>>>>>> [TEXT]UPLOAD-DIRECTORY=3D../../pdfuploads/pdf-files[/TEXT]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [FORMVARIABLES name=3D_UPLOADEDFILENAME&exact=3DF]>>>>>>>>>>>> [HIDEIF [URL][value][/URL]=3D]>>>>>>>>>>>> [SHOWIF [url][name][/url]^[url]name=3D"[/url]]>>>>>>>>>>>> [HIDEIF [url][name][/url]^[url]filename=3D"[/url]]>>>>>>>>>>>> [TEXT][MIDDLE>>>>>>>>>>>> StartAfter=3Dname=3D"&endbefore=3D"][name][/MIDDLE]=3D[value=][/TEXT]>>>>>>>>>>>> [/HIDEIF]>>>>>>>>>>>> [/SHOWIF]>>>>>>>>>>>> [SHOWIF [url][name][/url]^[url]filename=3D"[/url]]>>>>>>>>>>>> [TEXT]FULLFILENAME=3D[MIDDLE>>>>>>>>>>>> StartAfter=3Dfilename=3D"&endbefore=3D"][name][/MIDDLE][/TEX=T]>>>>>>>>>>>> [listwords words=3D[FULLFILENAME]&delimiters=3D:/\]>>>>>>>>>>>> [TEXT]THISFILENAME=3D[LOWERCASE][convertchars>>>>>>>>>>>> db=3D^noillegals.db][word][/convertchars][/LOWERCASE][/TEXT]>>>>>>>>>>>> [/listwords]>>>>>>>>>>>> [!]-------------- write the file to [UPLOAD-DIRECTORY]>>>>>>>>>>>> --------------[/!]>>>>>>>>>>>> [SHOWIF [FULLFILENAME]=3D]>>>>>>>>>>>> [TEXT]UPLOADMESSAGE=3DNo file was chosen to upload.[/TEXT]>>>>>>>>>>>> [/SHOWIF]>>>>>>>>>>>> [HIDEIF [FULLFILENAME]=3D]>>>>>>>>>>>> [WRITEFILE>>>>>>>>>>>> Secure=3DF&file=3D[UPLOAD-DIRECTORY]/[THISFILENAME]][value][=/WRITEFILE]>>>>>>>>>>>> [TEXT]UPLOADMESSAGE=3D[THISFILENAME] was added to the>>>>>>>>>>>> pdf-files directory.[/TEXT]>>>>>>>>>>>> [/HIDEIF]>>>>>>>>>>>> [/SHOWIF]>>>>>>>>>>>> [/HIDEIF]>>>>>>>>>>>> [/FORMVARIABLES]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> noillegals.db file contents:>>>>>>>>>>>>>>>>>>>>>>>> fromto>>>>>>>>>>>> _>>>>>>>>>>>> #>>>>>>>>>>>> @>>>>>>>>>>>> ,>>>>>>>>>>>> ;>>>>>>>>>>>> $>>>>>>>>>>>> !>>>>>>>>>>>> />>>>>>>>>>>> \>>>>>>>>>>>> :>>>>>>>>>>>> +>>>>>>>>>>>> +>>>>>>>>>>>> *>>>>>>>>>>>> (>>>>>>>>>>>> )>>>>>>>>>>>> &>>>>>>>>>>>> ^>>>>>>>>>>>> %>>>>>>>>>>>> <>>>>>>>>>>>>>>>>>>>>>>>>> ~>>>>>>>>>>>> `>>>>>>>>>>>> [>>>>>>>>>>>> ]>>>>>>>>>>>> {>>>>>>>>>>>> }>>>>>>>>>>>> ">>>>>>>>>>>> '>>>>>>>>>>>> ?>>>>>>>>>>>> =3D>>>>>>>>>>>> _>>>>>>>>>>>> =E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80==93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93==E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2==80=93=E2=80=93END OF>>>>>>>>>>>> FILE=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2==80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80==93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93==E2=80=93=E2=80=93>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Kind regards>>>>>>>>>>>>>>>>>>>>>>>> Stuart Tremain>>>>>>>>>>>> Pharoah Lane Software>>>>>>>>>>>> AUSTRALIA>>>>>>>>>>>> webdna@idfk.com.au >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 15 Dec 2016, at 04:26, Palle Bo Nielsen>>>>>>>>>>>>> >>>>>>>>>>>> > wrote:>>>>>>>>>>>>>>>>>>>>>>>>>> Hi Tom>>>>>>>>>>>>>>>>>>>>>>>>>> Thanks for the tip. It gave me the name of the file>>>>>>>>>>>>> and the file type but not the actual file content.>>>>>>>>>>>>>>>>>>>>>>>>>> So why is it that I am able to get this data within a>>>>>>>>>>>>> sendmail/lformvariables context when I can not get it>>>>>>>>>>>>> without the the sendmail?>>>>>>>>>>>>>>>>>>>>>>>>>> /Palle>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 14 Dec 2016, at 16.08, Tom Duke>>>>>>>>>>>>>> >>>>>>>>>>>>> > wrote:>>>>>>>>>>>>>>>>>>>>>>>>>>>> Palle,>>>>>>>>>>>>>>>>>>>>>>>>>>>> Set your 'imageUploadURL' to a WedDNA page.>>>>>>>>>>>>>>>>>>>>>>>>>>>> Then on that page add a [sendmail] to yourself with>>>>>>>>>>>>>> a [formvariables] in the body of the email:>>>>>>>>>>>>>>>>>>>>>>>>>>>> [sendmail to=3Dmyemail@email.com>>>>>>>>>>>>>> &from=3Dfroala@email.com>>>>>>>>>>>>>> &subject=3DFroala Editor>>>>>>>>>>>>>> Upload Params]>>>>>>>>>>>>>>>>>>>>>>>>>>>> [formvariables][name]:[value]
>>>>>>>>>>>>>> [/formvariables]>>>>>>>>>>>>>>>>>>>>>>>>>>>> [/sendmail]>>>>>>>>>>>>>>>>>>>>>>>>>>>> That will show you what data is being passed by the>>>>>>>>>>>>>> editor. You should then be able to parse and deal>>>>>>>>>>>>>> with it. You *might* need to change the>>>>>>>>>>>>>> 'imageUploadMethod' to 'post'.>>>>>>>>>>>>>>>>>>>>>>>>>>>> There is info in the archives on how to deal with>>>>>>>>>>>>>> image uploads (i.e>>>>>>>>>>>>>> http://webdna.us/page.dna?numero=3D58031).>>>>>>>>>>>>>>>>>>>>>>>>>>>> - Tom>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D==3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D==3D>>>>>>>>>>>>>> Digital Revolutionaries>>>>>>>>>>>>>> 1st Floor, Castleriver House>>>>>>>>>>>>>> 14-15 Parliament Street>>>>>>>>>>>>>> Temple Bar,Dublin 2>>>>>>>>>>>>>> Ireland>>>>>>>>>>>>>> ---------------------------------------------->>>>>>>>>>>>>> [t]: + 353 1 4403907>>>>>>>>>>>>>> [e]: >>>>>>>>>>>>>> [w]: >>>>>>>>>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D==3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D==3D>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 14 December 2016 at 11:06, Palle Bo Nielsen>>>>>>>>>>>>>> >>>>>>>>>>>>> > wrote:>>>>>>>>>>>>>> So I stated a project page where a lot is running as>>>>>>>>>>>>>> it should.>>>>>>>>>>>>>>>>>>>>>>>>>>>> Current problem is that I need to make the form>>>>>>>>>>>>>> accept the drag/drop image into the Textarea form>>>>>>>>>>>>>> which is supported by Froala. It depends on some JS>>>>>>>>>>>>>> code=E2=80=A6>>>>>>>>>>>>>>>>>>>>>>>>>>>> imageUploadParam: 'file_name',>>>>>>>>>>>>>> imageUploadURL: '/dev/froala/image',>>>>>>>>>>>>>> imageUploadMethod: 'PUT',>>>>>>>>>>>>>> imageMaxSize: 1024 * 1024 * 3,>>>>>>>>>>>>>> imageAllowedTypes: ['jpeg', 'jpg', 'png'],>>>>>>>>>>>>>>>>>>>>>>>>>>>> How can i extract the =E2=80=9CimageUploadParam=E2=80=9D i=nto WebDNA>>>>>>>>>>>>>> and how do I catch and store it=E2=80=A6?>>>>>>>>>>>>>>>>>>>>>>>>>>>> =E2=80=9C...The upload flow for the image is quite simple>>>>>>>>>>>>>> and it is explained here:>>>>>>>>>>>>>> https://www.froala.com/wysiwyg-editor/docs/concepts/image/=upload.>>>>>>>>>>>>>> First of all you have to tell the editor where to>>>>>>>>>>>>>> make the upload request (imageUploadURL). Then, your>>>>>>>>>>>>>> server should catch the request, store the image and>>>>>>>>>>>>>> then return a response in JSON format that looks>>>>>>>>>>>>>> like this: { link: 'path/to/image.jpg' }=E2=80=A6">>>>>>>>>>>>>>>>>>>>>>>>>>>> If you have anything to add/contribute or just being>>>>>>>>>>>>>> helpful then visits>>>>>>>>>>>>>> http://www.qt.dk/dev/froala/image/ (id and pass is>>>>>>>>>>>>>> lowercase =E2=80=98a=E2=80=99).>>>>>>>>>>>>>>>>>>>>>>>>>>>> /Palle>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 17 Nov 2016, at 07.55, Stuart Tremain>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> wrote:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Hey Palle>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> I had a bit of a look at this, it seems that>>>>>>>>>>>>>>>> Froala want a JSON response: such as>>>>>>>>>>>>>>>> {"link":"https://i.froala.com/download/6143ec97622356aae=b01df3b648b11a0f3176636.jpg?1479365089=E2=80=9D}>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> You can see this by viewing what the AJAX is>>>>>>>>>>>>>>>> returning.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> I did have a bit of trouble making JSON work>>>>>>>>>>>>>>>> properly on a server a while ago, the response>>>>>>>>>>>>>>>> needs to be handled properly through Apache &>>>>>>>>>>>>>>>> webdna without any spaces at the beginning. If you>>>>>>>>>>>>>>>> have problems, I will have a dig around for what I>>>>>>>>>>>>>>>> did to fix it for a system that I developed.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Kind regards>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Stuart Tremain>>>>>>>>>>>>>>>> Pharoah Lane Software>>>>>>>>>>>>>>>> AUSTRALIA>>>>>>>>>>>>>>>> webdna@idfk.com.au >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 7 Nov. 2016, at 02:15, Palle Bo Nielsen>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> > wrote:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Evening all>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Some of you might know the Froala Javascript>>>>>>>>>>>>>>>>> Editor which in my opinion is a great editor. The>>>>>>>>>>>>>>>>> editor enabled a lot of function within a>>>>>>>>>>>>>>>>> textarea which for me works great. One of the>>>>>>>>>>>>>>>>> function where I have not been able to make it>>>>>>>>>>>>>>>>> work is the the image function where you can drag>>>>>>>>>>>>>>>>> and drop an image to the textarea - the image is>>>>>>>>>>>>>>>>> being uploaded and displayed in the textarea. The>>>>>>>>>>>>>>>>> reason for me not being able to make it work is>>>>>>>>>>>>>>>>> that the Froala Editor expects some handling>>>>>>>>>>>>>>>>> server side and I can not figure it out. The>>>>>>>>>>>>>>>>> great thing is that I have WebDNA to provide me>>>>>>>>>>>>>>>>> with the server side stuff; the bad thing is that>>>>>>>>>>>>>>>>> I can not see what is needed.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> https://www.froala.com/wysiwyg-editor/docs/concepts/ima=ge/upload>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Any care to join me in making it happen?>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> The result could be used by Froala as an official>>>>>>>>>>>>>>>>> WebDNA SDK just as an PHP has been published.>>>>>>>>>>>>>>>>> This could benefit the WebDNA community.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> https://www.froala.com/wysiwyg-editor>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> https://www.froala.com/wysiwyg-editor/docs>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> I hope for a positive response :)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /Palle>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -------------------------------------------------------=-->>>>>>>>>>>>>>>>> This message is sent to you because you are>>>>>>>>>>>>>>>>> subscribed to the mailing list . To unsubscribe,>>>>>>>>>>>>>>>>> E-mail to: archives:>>>>>>>>>>>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug>>>>>>>>>>>>>>>>> Reporting: support@webdna.us>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> --------------------------------------------------------=->>>>>>>>>>>>>>>> This message is sent to you because you are>>>>>>>>>>>>>>>> subscribed to the mailing list . To unsubscribe,>>>>>>>>>>>>>>>> E-mail to: archives:>>>>>>>>>>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug>>>>>>>>>>>>>>>> Reporting: support@webdna.us>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> --------------------------------------------------------->>>>>>>>>>>>>>> This message is sent to you because you are>>>>>>>>>>>>>>> subscribed to the mailing list . To unsubscribe,>>>>>>>>>>>>>>> E-mail to: archives:>>>>>>>>>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug>>>>>>>>>>>>>>> Reporting: support@webdna.us >>>>>>>>>>>>>>>>>>>>>>>>>>>> --------------------------------------------------------->>>>>>>>>>>>>> This message is sent to you because you are>>>>>>>>>>>>>> subscribed to the mailing list . To unsubscribe,>>>>>>>>>>>>>> E-mail to: archives:>>>>>>>>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug>>>>>>>>>>>>>> Reporting: support@webdna.us >>>>>>>>>>>>>>>>>>>>>>>>>>>> --------------------------------------------------------->>>>>>>>>>>>>> This message is sent to you because you are>>>>>>>>>>>>>> subscribed to the mailing list . To unsubscribe,>>>>>>>>>>>>>> E-mail to: archives:>>>>>>>>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug>>>>>>>>>>>>>> Reporting: support@webdna.us >>>>>>>>>>>>>>>>>>>>>>>>>> --------------------------------------------------------->>>>>>>>>>>>> This message is sent to you because you are>>>>>>>>>>>>> subscribed to the mailing list . To unsubscribe,>>>>>>>>>>>>> E-mail to: archives:>>>>>>>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug>>>>>>>>>>>>> Reporting: support@webdna.us >>>>>>>>>>>>>>>>>>>>>>>> --------------------------------------------------------->>>>>>>>>>>> This message is sent to you because you are subscribed>>>>>>>>>>>> to the mailing list . To unsubscribe, E-mail to:>>>>>>>>>>>> archives: http://mail.webdna.us/list/talk@webdna.us>>>>>>>>>>>> Bug Reporting: support@webdna.us>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>> --------------------------------------------------------->>>>>>>>>>> This message is sent to you because you are subscribed>>>>>>>>>>> to the mailing list . To unsubscribe, E-mail to:>>>>>>>>>>> archives: http://mail.webdna.us/list/talk@webdna.us Bug>>>>>>>>>>> Reporting: support@webdna.us >>>>>>>>>>>>>>>>>>>> --------------------------------------------------------- This>>>>>>>>>> message is sent to you because you are subscribed to the>>>>>>>>>> mailing list . To unsubscribe, E-mail to: archives:>>>>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:>>>>>>>>>> support@webdna.us >>>>>>>>>>>>>>>>>> --------------------------------------------------------->>>>>>>>> This message is sent to you because you are subscribed to>>>>>>>>> the mailing list >.>>>>>>>>> To unsubscribe, E-mail to: >>>>>>>> >>>>>>>>>> archives: http://mail.webdna.us/list/talk@webdna.us>>>>>>>>> Bug Reporting: support@webdna.us >>>>>>>>>>>>>>>> --------------------------------------------------------->>>>>>>> This message is sent to you because you are subscribed to>>>>>>>> the mailing list . To unsubscribe, E-mail to: archives:>>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:>>>>>>>> support@webdna.us >>>>>>>>>>>>>> --------------------------------------------------------->>>>>>> This message is sent to you because you are subscribed to>>>>>>> the mailing list . To unsubscribe, E-mail to: archives:>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:>>>>>>> support@webdna.us >>>>>>>>>>>> --------------------------------------------------------->>>>>> This message is sent to you because you are subscribed to>>>>>> the mailing list . To unsubscribe, E-mail to: archives:>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:>>>>>> support@webdna.us >>>>>>>>>> --------------------------------------------------------->>>>> This message is sent to you because you are subscribed to the>>>>> mailing list . To unsubscribe, E-mail to: archives:>>>>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:>>>>> support@webdna.us >>>>>>>> --------------------------------------------------------- This>>>> message is sent to you because you are subscribed to the>>>> mailing list . To unsubscribe, E-mail to: archives:>>>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:>>>> support@webdna.us >>>>>>> --------------------------------------------------------- This>> message is sent to you because you are subscribed to the mailing>> list . To unsubscribe, E-mail to: archives:>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:>> support@webdna.us >=20> --------------------------------------------------------- This> message is sent to you because you are subscribed to the mailing> list . To unsubscribe, E-mail to: archives:> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:> support@webdna.us---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list .To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us.
Associated Messages, from the most recent to the oldest:
872This is better:[!]HAS_WEBDNA_TAGS[/!]Regards,Kenneth GromeWebDNA Solutionshttp://www.webdnasolutions.comWeb Database Systems and Linux Server AdministrationOn 12/28/2016 06:06 AM, Christer Olsson wrote:> You can put [/SHOWIF]>=20> Best,> Christer>=20> *************************************************************> Christer Olsson PO Box 9160 Phone +46 40 25 85 85> Ljusa Id=C3=A9er AB SE-200 39 Malmo Fax +46 40 25 85 89> Kantyxegatan 5 Sweden http://www.ljusaideer.se>=20>=20>> 28 dec. 2016 kl. 12:57 skrev Palle Bo Nielsen>> >:>>>> Hi Stuart>>>> I had a conversation with the guys behind the Froala framework>> and it seems like the missing linking this algorithm is the fact>> that the JSON output *must=E2=80=99 stand alone, than being without an=y>> HTML og Tags of any kind in the HTML source.>>>> So basically this JSON was correct, but it MUST be the only>> output to the browser. So now the question is, how to make this>> happen without to popular the [VA=R_INDEX]>> and without tags of any kind. I would like to avoid>> having =E2=80=9Calways interpret an html page with webdna=E2=80=9D ena=bled.>>>> { link:>> 'http://qt.dk/dev/froala/image/inspirations/[VAR_INDEX].jpg' }>>>> /Palle>>>>>>>>>>>>>>>> On 27 Dec 2016, at 22.04, Stuart Tremain >>> > wrote:>>>>>>>> Try this, also you had a curly =E2=80=98 after .jpg>>>>>>>>>>>>>>>> [text]VAR_INDEX=3D[format 10.0f][cart][/format][/TEXT][!]>>>> [/!][text]SHORTPATH=3D/dev/froala/image/inspirations[/TEXT][!]>>>>>>>> [/!][formvariables][!]>>>> [/!][showif [name]^file_name][!]>>>> [/!][WRITEFILE>>>> Secure=3DF&File=3D[SHORTPATH]/[VAR_INDEX].jpg][value][/WRITEFILE][!]>>>> [/!][/showif][!]>>>> [/!][/FORMVARIABLES][!]>>>>>>>> [/!]{ link:>>>> 'http://qt.dk/dev/froala/image/inspirations/[VAR_INDEX].jpg' }>>>>>>>>>>>>>>>>>>>>>>>> Kind regards>>>>>>>> Stuart Tremain>>>> Pharoah Lane Software>>>> AUSTRALIA>>>> webdna@idfk.com.au >>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 28 Dec 2016, at 07:57, Palle Bo Nielsen>>>>> >>>>>> wrote:>>>>>>>>>> Evening Stuart>>>>>>>>>> So I truncated your original code a bit to make it less>>>>> complex in this Proof of Concept setup.>>>>>>>>>> As you can see when you visit the page>>>>> (qt.dk/dev/froala/image/ ) ->>>>> you are able to drag and drop an image to the Froala textarea>>>>> field and the image is showing in the same field.>>>>>>>>>> The actual image is matched by the server and saved on the>>>>> server and a JSON is produced but probably not coached by the>>>>> Froala framework as the image has a error text below the>>>>> image and the image disappears when clicking in the textarea>>>>> field.>>>>>>>>>> When you state that =E2=80=9C...Make sure that there is nothing abo=ve>>>>> or below this response as JSON is sensitive=E2=80=A6=E2=80=9D do yo=u then>>>>> indicate that the output in the browser is not even allowed>>>>> to include normal html tags like =E2=80=9Chtml, head, body, etc.=E2==80=9D ?=20>>>>>>>>>> My truncated code below:>>>>>>>>>> [text]VAR_INDEX=3D[format 10.0f][cart][/format][/TEXT]>>>>> [text]SHORTPATH=3D/dev/froala/image/inspirations[/TEXT]>>>>>>>>>> [formvariables]>>>>> [showif [name]^file_name]>>>>> [WRITEFILE>>>>> Secure=3DF&File=3D[SHORTPATH]/[VAR_INDEX].jpg][value][/WRITEFILE]>>>>> [/showif]>>>>> [/FORMVARIABLES]>>>>>>>>>> { link:>>>>> 'http://qt.dk/dev/froala/image/inspirations/[VAR_INDEX].jpg=E2=80=99>>>>> >>>>> }>>>>>>>>>> /Palle>>>>>>>>>>>>>>>> On 27 Dec 2016, at 17.49, Stuart Tremain >>>>> > wrote:>>>>>>>>>>>> Hi Palle>>>>>>>>>>>> Merry Christmas.>>>>>>>>>>>> According to the Froala docs:>>>>>>>>>>>> https://froala.com/wysiwyg-editor/docs/concepts/image/upload>>>>>>>>>>>> =E2=80=9C4. The server processes the HTTP request.>>>>>> The server has to process the upload request, save the image>>>>>> and return a JSON containing a link to the uploaded image.>>>>>> The returned JSON needs to look like: { link:>>>>>> 'path/to/image.jpg=E2=80=99 }=E2=80=9D>>>>>>>>>>>> or if there is an error return {error: 'error message'}>>>>>>>>>>>> Make sure that there is nothing above or below this response>>>>>> as JSON is sensitive to have any other =E2=80=9Cclutter=E2=80=9D i=n the>>>>>> response, you will notice that in my code all line breaks>>>>>> etc are commented so that the only visible code in a>>>>>> rendered page is:>>>>>> { "filelink":>>>>>> "http://assets.mydomain.com.au/inspirations/[THISIMAGENAME]=E2=80=9D= }>>>>>>>>>>>> JSON is case sensitive.>>>>>>>>>>>>>>>>>>>>>>>> Kind regards>>>>>>>>>>>> Stuart Tremain>>>>>> Pharoah Lane Software>>>>>> AUSTRALIA>>>>>> webdna@idfk.com.au >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 28 Dec 2016, at 01:14, Palle Bo Nielsen>>>>>>> >>>>>> > wrote:>>>>>>>>>>>>>> Hi Stuart>>>>>>>>>>>>>> Thanks for pushing me in the right direction.>>>>>>>>>>>>>> By using fragments of your code I have managed to actually>>>>>>> catch the image and store it locally. My next challenge>>>>>>> would be to reply with a JSON, which you so accurately>>>>>>> guessed in your response to me.>>>>>>>>>>>>>> I would guess that your are delivering your Redactor>>>>>>> feedback using the code below, but (novice as I am using>>>>>>> JSON) it does not look like a JSO string to me=E2=80=A6>>>>>>>>>>>>>> -------------- TELL REDACTOR THE FILE NAME --------------=20>>>>>>> { "filelink":>>>>>>> "http://assets.mydomain.com.au/inspirations/[THISIMAGENAME]=E2=80==9D }>>>>>>>>>>>>>> Are you actually telling my that the response to Froala>>>>>>> could be as simple as =E2=80=98printing=E2=80=99 something like t=his=E2=80=A6??>>>>>>>>>>>>>> http://qt.dk/dev/froala/image/inspirations/**the_file_name**>>>>>>>>>>>>>> /Palle>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 20 Dec 2016, at 05.13, Stuart Tremain>>>>>>>> > wrote:>>>>>>>>>>>>>>>> Hi Palle>>>>>>>>>>>>>>>> I had a look at your test page and dragged an image into>>>>>>>> the text area.>>>>>>>>>>>>>>>> Immediately after dragging the image an XHR fired up>>>>>>>> (https://www.dropbox.com/s/yfdiqsw3vravfv8/Screen%20Shot%202016-=12-20%20at%2015.07.25.png?dl=3D0).>>>>>>>> This is where you need to have a WebDNA page to capture>>>>>>>> and save the image.>>>>>>>>>>>>>>>> I am using a similar system called Redactor to drag & drop>>>>>>>> images to a text area>>>>>>>> (https://www.dropbox.com/s/n7hfeemss2w4i0j/Screen%20Shot%202016-=12-20%20at%2015.07.08.png?dl=3D0),>>>>>>>> you can see the XHR image-s1.dna file that fired when I>>>>>>>> dropped the image in the text area.>>>>>>>>>>>>>>>> The image-s1.dna file captures the image, uses imagemagick>>>>>>>> to resize it, then moves the image to an Amazon S3 server,>>>>>>>> deletes the uploaded image and sends back to redactor JSON>>>>>>>> data about the file.>>>>>>>>>>>>>>>> It looks as if you do not have a file to capture the image>>>>>>>> data.>>>>>>>>>>>>>>>> On line 447 of your rendered code you will find this:>>>>>>>>>>>>>>>>>>>>>>>> // Set the image upload URL.>>>>>>>> imageUploadURL: '/dev/froala/image=E2=80=99,>>>>>>>>>>>>>>>> What you need to do is put a WebDNA file at that location>>>>>>>> to capture the file & store it. So set an upload url e.g.:=20>>>>>>>>>>>>>>>> // Set the image upload URL.>>>>>>>> imageUploadURL: '/dev/froala/image/image-capture.dna=E2=80=99,>>>>>>>>>>>>>>>> In image-capture.dna put>>>>>>>>>>>>>>>> [formvariables][name]:[value]>>>>>>>> [/formvariables]>>>>>>>>>>>>>>>> in the page. You will be able to see what data is being>>>>>>>> passed, then you just need to handle the data and save the>>>>>>>> file. I would presume that Froala will require a response,>>>>>>>> probably JSON formatted.>>>>>>>>>>>>>>>>>>>>>>>> Here is the contents of my image-s1.dna file: PLEASE NOTE>>>>>>>> THAT THIS SITE IS IN A SANDBOX>>>>>>>>>>>>>>>> #####################################################>>>>>>>> [!] -------------- _IMAGE START --------------=20>>>>>>>> [/!][text]IMAGEFILENAME=3D[/TEXT][!]>>>>>>>> [/!][text]CELLSIZE=3D118[/TEXT][!]>>>>>>>> [/!][text]SHORTPATH=3D../../../imageprocessing/inspirations[/TEX=T][!]>>>>>>>> [/!][text]LONGPATH=3D/var/www/imageprocessing/inspirations[/TEXT=][!]>>>>>>>> [/!][FORMVARIABLES name=3DFILE&exact=3DF][!]>>>>>>>> [/!][HIDEIF [url][value][/URL]=3D][!]>>>>>>>> [/!][SHOWIF [url][name][/url]^[url]name=3D"[/url]][!]>>>>>>>> [/!][HIDEIF [url][name][/url]^[url]filename=3D"[/url]][TEXT>>>>>>>> show=3DT][MIDDLE>>>>>>>> StartAfter=3Dname=3D"&endbefore=3D"][name][/MIDDLE]=3D[value][/T=EXT][/HIDEIF][!]>>>>>>>> [/!][/SHOWIF][!]>>>>>>>> [/!][SHOWIF [url][name][/url]^[url]filename=3D"[/url]][!]>>>>>>>> [/!][text]FULLFILENAME=3D[MIDDLE>>>>>>>> StartAfter=3Dfilename=3D"&endbefore=3D"][name][/MIDDLE][/TEXT][!=]>>>>>>>> [/!][listwords>>>>>>>> words=3D[FULLFILENAME]&delimiters=3D:/\][text]THISIMAGENAME=3D[M=ATH]{[date]}[/MATH][math]{[time]}[/MATH]-[lowercase][convertchars>>>>>>>> db=3D^noillegals.db][word][/convertchars][/LOWERCASE][/TEXT][/li=stwords][!]>>>>>>>> -------------- write the file to upload dir -------------->>>>>>>> [/!][HIDEIF [FULLFILENAME]=3D][!]>>>>>>>> ------------------- IMAGEMAGICK ----------------->>>>>>>> [/!][WRITEFILE>>>>>>>> Secure=3DF&File=3D[SHORTPATH]/[THISIMAGENAME]][value][/WRITEFILE=][!]>>>>>>>> [/!][text]IMAGEWIDTH=3D[CELLSIZE][/TEXT][!]>>>>>>>> [/!][text]IMAGEHEIGHT=3D[CELLSIZE][/TEXT][!]>>>>>>>> [/!][text]IMAGEQUALITY=3D80[/TEXT][!]>>>>>>>> [/!][text]IMAGESWITCH=3D![/TEXT][!] ! =3D exactly this size=20>>>>>>>> [/!][text]IMAGEPATH=3D[LONGPATH][/TEXT][!]>>>>>>>> [/!][text]IMAGEFILENAME=3D[THISIMAGENAME][/TEXT][!]>>>>>>>> [/!][text]QUIET=3D[SHELL>>>>>>>> scriptid=3DT3IMAGERESIZE][/SHELL][/TEXT][!]>>>>>>>> ------------------- MOVE THE IMAGES TO S3 ----------------->>>>>>>> [/!][LISTFILES path=3D[SHORTPATH]/][!]>>>>>>>> [/!][text]THISS3CMD=3Ds3cmd put --acl-public>>>>>>>> /var/www/imageprocessing/inspirations/[FILENAME]>>>>>>>> s3://assets.mydomain.com.au/inspirations/>>>>>>>> --add-header=3DCache-Control:max-age=3D2592000>>>>>>>> --config=3D/usr/lib/cgi-bin/WebCatalogEngine/SandBoxes/MYSANDBOX=/Globals/.awards-s3cfg[/TEXT][!]>>>>>>>> [/!][text]QUIET=3D[SHELL scriptid=3DAWSS3][/SHELL][/TEXT][!]>>>>>>>> [/!][/LISTFILES][!]>>>>>>>>>>>>>>>> ------------------- REMOVE ALL FILES FROM ORIGINALS/THUMBS>>>>>>>> etc ----------------->>>>>>>> [/!][LISTFILES path=3D[SHORTPATH]/][DELETEFILE>>>>>>>> file=3D[SHORTPATH]/[FILENAME]][/LISTFILES][!]>>>>>>>> [/!][/HIDEIF][!]>>>>>>>> [/!][/SHOWIF][!]>>>>>>>> [/!][/HIDEIF][!]>>>>>>>> [/!][/FORMVARIABLES][!]=20>>>>>>>> -------------- TELL REDACTOR THE FILE NAME --------------=20>>>>>>>> [/!]{ "filelink":>>>>>>>> "http://assets.mydomain.com.au/inspirations/[THISIMAGENAME]=E2=80==9D }>>>>>>>> #####################################################>>>>>>>>>>>>>>>>>>>>>>>> Kind regards>>>>>>>>>>>>>>>> Stuart Tremain>>>>>>>> Pharoah Lane Software>>>>>>>> AUSTRALIA>>>>>>>> webdna@idfk.com.au >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 18 Dec 2016, at 00:29, Palle Bo Nielsen>>>>>>>>> >>>>>>>> > wrote:>>>>>>>>>>>>>>>>>> Hi Stuaty>>>>>>>>>>>>>>>>>> Thanks for your interest.>>>>>>>>>>>>>>>>>> Ok, let me repeat the baseline just make sure we do not>>>>>>>>> misunderstand the setup.>>>>>>>>>>>>>>>>>> I have made test page which uses the Froala framework>>>>>>>>> with the aim of using the function of drag=E2=80=99n=E2=80=99dr=op and>>>>>>>>> image into the TextArea field, only to be catched/saved>>>>>>>>> Server Side and presented Client Side as per the concept>>>>>>>>> of Froala. I need this solution on my next website which>>>>>>>>> is currently under development. So basically WebDNA as>>>>>>>>> Server Side and Froala as Client Side.>>>>>>>>>>>>>>>>>> You will find my test set up at the follow URL (id: a ->>>>>>>>> pswd: a)>>>>>>>>>>>>>>>>>> http://qt.dk/dev/froala/image/>>>>>>>>>>>>>>>>>> Information about the Froala client is here (wysiwyg html>>>>>>>>> editor)>>>>>>>>>>>>>>>>>> https://www.froala.com/wysiwyg-editor/>>>>>>>>>>>>>>>>>> But more important. Information about the Image>>>>>>>>> drag=E2=80=99n=E2=80=99drop into Textarea her=E2=80=A6>>>>>>>>>>>>>>>>>> https://www.froala.com/wysiwyg-editor/docs/concepts/image/uploa=d>>>>>>>>>>>>>>>>>> You suggested to include a [FormVariables =E2=80=A6] on the pag=e.>>>>>>>>> I already did and therefor you can already find debug>>>>>>>>> information at the bottom of the page (qt.dk>>>>>>>>> =E2=80=A6)>>>>>>>>>>>>>>>>>> So the actual Froala Framework is setup and it works. M=C3=BD>>>>>>>>> challenge is to get the drag=E2=80=99ndrop image into textarea =to>>>>>>>>> work. I am not sure how to catch the file from the Froala>>>>>>>>> framework to start with. Maybe I already did but again>>>>>>>>> then I do not know how to store it (save) server side.>>>>>>>>>>>>>>>>>> I would really appreciate some guidance to get this>>>>>>>>> working and I will make sure the final result will be>>>>>>>>> shared within the webdna community as well as webdna.us>>>>>>>>> and froala.com .>>>>>>>>>>>>>>>>>> You also mention that =E2=80=9C...From what I see in the script=,>>>>>>>>> the receiving url for the file is: imageUploadURL:>>>>>>>>> '/upload_image=E2=80=99, =E2=80=A6=E2=80=9D. You might look at =the wrong place as>>>>>>>>> the ImageUploadUrl is: "/dev/froala/image">>>>>>>>>>>>>>>>>> /Palle>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 15 Dec 2016, at 23.15, Stuart Tremain>>>>>>>>>> > wrote:>>>>>>>>>>>>>>>>>>>> Hi Palle>>>>>>>>>>>>>>>>>>>> Thanks for the link, now I can see what is going on.>>>>>>>>>>>>>>>>>>>> From what I see in the script, the receiving url for the>>>>>>>>>> file is:>>>>>>>>>>>>>>>>>>>> // Set the image upload URL.>>>>>>>>>>>>>>>>>>>> imageUploadURL>>>>>>>>>> : '/upload_image',>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> If you put [FormVariables>>>>>>>>>> name=3D&exact=3DF][name]=3D[value]
[/FormVariables] on this>>>>>>>>>> page and then post the results, I will be able to see>>>>>>>>>> what is going on, you can do this by looking at the XHRs>>>>>>>>>> results in your browser.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Kind regards>>>>>>>>>>>>>>>>>>>> Stuart Tremain>>>>>>>>>> Pharoah Lane Software>>>>>>>>>> AUSTRALIA>>>>>>>>>> webdna@idfk.com.au >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 16 Dec 2016, at 07:25, Palle Bo Nielsen>>>>>>>>>>> >>>>>>>>>> > wrote:>>>>>>>>>>>>>>>>>>>>>> Hi Stuart>>>>>>>>>>>>>>>>>>>>>> Please stop me if am using to much of your time, but=E2=80=A6>>>>>>>>>>>>>>>>>>>>>> First of all. If I understand your code correctly then>>>>>>>>>>> it assumes that a formvariable exist by the name of>>>>>>>>>>> <=E2=80=9C_UPLOADEDFILENAME=E2=80=9D> (your example), in my c=ase it>>>>>>>>>>> should be <=E2=80=9Cfile_name=E2=80=9D> hence the =E2=80=98im=ageUploadParam=E2=80=99>>>>>>>>>>> which is set in the JS code.>>>>>>>>>>>>>>>>>>>>>> https://www.froala.com/wysiwyg-editor/docs/concepts/image/upl=oad>>>>>>>>>>>>>>>>>>>>>> But the [formvariables=E2=80=A6] does not result in any>>>>>>>>>>> variable by that name or any other which is relevant>>>>>>>>>>> for this proces which leaves me in a situation where I>>>>>>>>>>> have nothing to catch from the JS/Image File supposedly>>>>>>>>>>> being uploaded.>>>>>>>>>>>>>>>>>>>>>> I think I understand the rest of the code but it is a>>>>>>>>>>> prerequisite than the formvariable is being identified>>>>>>>>>>> and catched, right?>>>>>>>>>>>>>>>>>>>>>> /Palle>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 14 Dec 2016, at 21.52, Stuart Tremain>>>>>>>>>>>> > wrote:>>>>>>>>>>>>>>>>>>>>>>>> Hi Palle>>>>>>>>>>>>>>>>>>>>>>>> You will find that the file is being uploaded in a>>>>>>>>>>>> multipart/form-data form, therefore you need to deal>>>>>>>>>>>> with the contents in a different way rather than as>>>>>>>>>>>> name valued pairs.>>>>>>>>>>>>>>>>>>>>>>>> Try this to capture the file name and it=E2=80=99s contents,= I>>>>>>>>>>>> have pulled it out of some working code:>>>>>>>>>>>>>>>>>>>>>>>> [text]UPLOAD-DIRECTORY=3D../../pdfuploads/pdf-files[/TEXT]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [FORMVARIABLES name=3D_UPLOADEDFILENAME&exact=3DF]>>>>>>>>>>>> [HIDEIF [url][value][/URL]=3D]>>>>>>>>>>>> [SHOWIF [url][name][/url]^[url]name=3D"[/url]]>>>>>>>>>>>> [HIDEIF [url][name][/url]^[url]filename=3D"[/url]]>>>>>>>>>>>> [text][MIDDLE>>>>>>>>>>>> StartAfter=3Dname=3D"&endbefore=3D"][name][/MIDDLE]=3D[value=][/TEXT]>>>>>>>>>>>> [/HIDEIF]>>>>>>>>>>>> [/SHOWIF]>>>>>>>>>>>> [SHOWIF [url][name][/url]^[url]filename=3D"[/url]]>>>>>>>>>>>> [text]FULLFILENAME=3D[MIDDLE>>>>>>>>>>>> StartAfter=3Dfilename=3D"&endbefore=3D"][name][/MIDDLE][/TEX=T]>>>>>>>>>>>> [listwords words=3D[FULLFILENAME]&delimiters=3D:/\]>>>>>>>>>>>> [text]THISFILENAME=3D[lowercase][convertchars>>>>>>>>>>>> db=3D^noillegals.db][word][/convertchars][/LOWERCASE][/TEXT]>>>>>>>>>>>> [/listwords]>>>>>>>>>>>> [!]-------------- write the file to [UPLOAD-DIRECTORY]>>>>>>>>>>>> --------------[/!]>>>>>>>>>>>> [SHOWIF [FULLFILENAME]=3D]>>>>>>>>>>>> [text]UPLOADMESSAGE=3DNo file was chosen to upload.[/TEXT]>>>>>>>>>>>> [/SHOWIF]>>>>>>>>>>>> [HIDEIF [FULLFILENAME]=3D]>>>>>>>>>>>> [WRITEFILE>>>>>>>>>>>> Secure=3DF&file=3D[UPLOAD-DIRECTORY]/[THISFILENAME]][value][=/WRITEFILE]>>>>>>>>>>>> [text]UPLOADMESSAGE=3D[THISFILENAME] was added to the>>>>>>>>>>>> pdf-files directory.[/TEXT]>>>>>>>>>>>> [/HIDEIF]>>>>>>>>>>>> [/SHOWIF]>>>>>>>>>>>> [/HIDEIF]>>>>>>>>>>>> [/FORMVARIABLES]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> noillegals.db file contents:>>>>>>>>>>>>>>>>>>>>>>>> fromto>>>>>>>>>>>> _>>>>>>>>>>>> #>>>>>>>>>>>> @>>>>>>>>>>>> ,>>>>>>>>>>>> ;>>>>>>>>>>>> $>>>>>>>>>>>> !>>>>>>>>>>>> />>>>>>>>>>>> \>>>>>>>>>>>> :>>>>>>>>>>>> +>>>>>>>>>>>> +>>>>>>>>>>>> *>>>>>>>>>>>> (>>>>>>>>>>>> )>>>>>>>>>>>> &>>>>>>>>>>>> ^>>>>>>>>>>>> %>>>>>>>>>>>> <>>>>>>>>>>>>>>>>>>>>>>>>> ~>>>>>>>>>>>> `>>>>>>>>>>>> [>>>>>>>>>>>> ]>>>>>>>>>>>> {>>>>>>>>>>>> }>>>>>>>>>>>> ">>>>>>>>>>>> '>>>>>>>>>>>> ?>>>>>>>>>>>> =3D>>>>>>>>>>>> _>>>>>>>>>>>> =E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80==93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93==E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2==80=93=E2=80=93END OF>>>>>>>>>>>> FILE=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2==80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80==93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93=E2=80=93==E2=80=93=E2=80=93>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Kind regards>>>>>>>>>>>>>>>>>>>>>>>> Stuart Tremain>>>>>>>>>>>> Pharoah Lane Software>>>>>>>>>>>> AUSTRALIA>>>>>>>>>>>> webdna@idfk.com.au >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 15 Dec 2016, at 04:26, Palle Bo Nielsen>>>>>>>>>>>>> >>>>>>>>>>>> > wrote:>>>>>>>>>>>>>>>>>>>>>>>>>> Hi Tom>>>>>>>>>>>>>>>>>>>>>>>>>> Thanks for the tip. It gave me the name of the file>>>>>>>>>>>>> and the file type but not the actual file content.>>>>>>>>>>>>>>>>>>>>>>>>>> So why is it that I am able to get this data within a>>>>>>>>>>>>> sendmail/lformvariables context when I can not get it>>>>>>>>>>>>> without the the sendmail?>>>>>>>>>>>>>>>>>>>>>>>>>> /Palle>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 14 Dec 2016, at 16.08, Tom Duke>>>>>>>>>>>>>> >>>>>>>>>>>>> > wrote:>>>>>>>>>>>>>>>>>>>>>>>>>>>> Palle,>>>>>>>>>>>>>>>>>>>>>>>>>>>> Set your 'imageUploadURL' to a WedDNA page.>>>>>>>>>>>>>>>>>>>>>>>>>>>> Then on that page add a [sendmail] to yourself with>>>>>>>>>>>>>> a [formvariables] in the body of the email:>>>>>>>>>>>>>>>>>>>>>>>>>>>> [sendmail to=3Dmyemail@email.com>>>>>>>>>>>>>> &from=3Dfroala@email.com>>>>>>>>>>>>>> &subject=3DFroala Editor>>>>>>>>>>>>>> Upload Params]>>>>>>>>>>>>>>>>>>>>>>>>>>>> [formvariables][name]:[value]
>>>>>>>>>>>>>> [/formvariables]>>>>>>>>>>>>>>>>>>>>>>>>>>>> [/sendmail]>>>>>>>>>>>>>>>>>>>>>>>>>>>> That will show you what data is being passed by the>>>>>>>>>>>>>> editor. You should then be able to parse and deal>>>>>>>>>>>>>> with it. You *might* need to change the>>>>>>>>>>>>>> 'imageUploadMethod' to 'post'.>>>>>>>>>>>>>>>>>>>>>>>>>>>> There is info in the archives on how to deal with>>>>>>>>>>>>>> image uploads (i.e>>>>>>>>>>>>>> http://webdna.us/page.dna?numero=3D58031).>>>>>>>>>>>>>>>>>>>>>>>>>>>> - Tom>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D==3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D==3D>>>>>>>>>>>>>> Digital Revolutionaries>>>>>>>>>>>>>> 1st Floor, Castleriver House>>>>>>>>>>>>>> 14-15 Parliament Street>>>>>>>>>>>>>> Temple Bar,Dublin 2>>>>>>>>>>>>>> Ireland>>>>>>>>>>>>>> ---------------------------------------------->>>>>>>>>>>>>> [t]: + 353 1 4403907>>>>>>>>>>>>>> [e]: >>>>>>>>>>>>>> [w]: >>>>>>>>>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D==3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D==3D>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 14 December 2016 at 11:06, Palle Bo Nielsen>>>>>>>>>>>>>> >>>>>>>>>>>>> > wrote:>>>>>>>>>>>>>> So I stated a project page where a lot is running as>>>>>>>>>>>>>> it should.>>>>>>>>>>>>>>>>>>>>>>>>>>>> Current problem is that I need to make the form>>>>>>>>>>>>>> accept the drag/drop image into the Textarea form>>>>>>>>>>>>>> which is supported by Froala. It depends on some JS>>>>>>>>>>>>>> code=E2=80=A6>>>>>>>>>>>>>>>>>>>>>>>>>>>> imageUploadParam: 'file_name',>>>>>>>>>>>>>> imageUploadURL: '/dev/froala/image',>>>>>>>>>>>>>> imageUploadMethod: 'PUT',>>>>>>>>>>>>>> imageMaxSize: 1024 * 1024 * 3,>>>>>>>>>>>>>> imageAllowedTypes: ['jpeg', 'jpg', 'png'],>>>>>>>>>>>>>>>>>>>>>>>>>>>> How can i extract the =E2=80=9CimageUploadParam=E2=80=9D i=nto WebDNA>>>>>>>>>>>>>> and how do I catch and store it=E2=80=A6?>>>>>>>>>>>>>>>>>>>>>>>>>>>> =E2=80=9C...The upload flow for the image is quite simple>>>>>>>>>>>>>> and it is explained here:>>>>>>>>>>>>>> https://www.froala.com/wysiwyg-editor/docs/concepts/image/=upload.>>>>>>>>>>>>>> First of all you have to tell the editor where to>>>>>>>>>>>>>> make the upload request (imageUploadURL). Then, your>>>>>>>>>>>>>> server should catch the request, store the image and>>>>>>>>>>>>>> then return a response in JSON format that looks>>>>>>>>>>>>>> like this: { link: 'path/to/image.jpg' }=E2=80=A6">>>>>>>>>>>>>>>>>>>>>>>>>>>> If you have anything to add/contribute or just being>>>>>>>>>>>>>> helpful then visits>>>>>>>>>>>>>> http://www.qt.dk/dev/froala/image/ (id and pass is>>>>>>>>>>>>>> lowercase =E2=80=98a=E2=80=99).>>>>>>>>>>>>>>>>>>>>>>>>>>>> /Palle>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 17 Nov 2016, at 07.55, Stuart Tremain>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> wrote:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Hey Palle>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> I had a bit of a look at this, it seems that>>>>>>>>>>>>>>>> Froala want a JSON response: such as>>>>>>>>>>>>>>>> {"link":"https://i.froala.com/download/6143ec97622356aae=b01df3b648b11a0f3176636.jpg?1479365089=E2=80=9D}>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> You can see this by viewing what the AJAX is>>>>>>>>>>>>>>>> returning.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> I did have a bit of trouble making JSON work>>>>>>>>>>>>>>>> properly on a server a while ago, the response>>>>>>>>>>>>>>>> needs to be handled properly through Apache &>>>>>>>>>>>>>>>> webdna without any spaces at the beginning. If you>>>>>>>>>>>>>>>> have problems, I will have a dig around for what I>>>>>>>>>>>>>>>> did to fix it for a system that I developed.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Kind regards>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Stuart Tremain>>>>>>>>>>>>>>>> Pharoah Lane Software>>>>>>>>>>>>>>>> AUSTRALIA>>>>>>>>>>>>>>>> webdna@idfk.com.au >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 7 Nov. 2016, at 02:15, Palle Bo Nielsen>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> > wrote:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Evening all>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Some of you might know the Froala Javascript>>>>>>>>>>>>>>>>> Editor which in my opinion is a great editor. The>>>>>>>>>>>>>>>>> editor enabled a lot of function within a>>>>>>>>>>>>>>>>> textarea which for me works great. One of the>>>>>>>>>>>>>>>>> function where I have not been able to make it>>>>>>>>>>>>>>>>> work is the the image function where you can drag>>>>>>>>>>>>>>>>> and drop an image to the textarea - the image is>>>>>>>>>>>>>>>>> being uploaded and displayed in the textarea. The>>>>>>>>>>>>>>>>> reason for me not being able to make it work is>>>>>>>>>>>>>>>>> that the Froala Editor expects some handling>>>>>>>>>>>>>>>>> server side and I can not figure it out. The>>>>>>>>>>>>>>>>> great thing is that I have WebDNA to provide me>>>>>>>>>>>>>>>>> with the server side stuff; the bad thing is that>>>>>>>>>>>>>>>>> I can not see what is needed.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> https://www.froala.com/wysiwyg-editor/docs/concepts/ima=ge/upload>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Any care to join me in making it happen?>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> The result could be used by Froala as an official>>>>>>>>>>>>>>>>> WebDNA SDK just as an PHP has been published.>>>>>>>>>>>>>>>>> This could benefit the WebDNA community.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> https://www.froala.com/wysiwyg-editor>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> https://www.froala.com/wysiwyg-editor/docs>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> I hope for a positive response :)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /Palle>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -------------------------------------------------------=-->>>>>>>>>>>>>>>>> This message is sent to you because you are>>>>>>>>>>>>>>>>> subscribed to the mailing list . To unsubscribe,>>>>>>>>>>>>>>>>> E-mail to: archives:>>>>>>>>>>>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug>>>>>>>>>>>>>>>>> Reporting: support@webdna.us>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> --------------------------------------------------------=->>>>>>>>>>>>>>>> This message is sent to you because you are>>>>>>>>>>>>>>>> subscribed to the mailing list . To unsubscribe,>>>>>>>>>>>>>>>> E-mail to: archives:>>>>>>>>>>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug>>>>>>>>>>>>>>>> Reporting: support@webdna.us>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> --------------------------------------------------------->>>>>>>>>>>>>>> This message is sent to you because you are>>>>>>>>>>>>>>> subscribed to the mailing list . To unsubscribe,>>>>>>>>>>>>>>> E-mail to: archives:>>>>>>>>>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug>>>>>>>>>>>>>>> Reporting: support@webdna.us >>>>>>>>>>>>>>>>>>>>>>>>>>>> --------------------------------------------------------->>>>>>>>>>>>>> This message is sent to you because you are>>>>>>>>>>>>>> subscribed to the mailing list . To unsubscribe,>>>>>>>>>>>>>> E-mail to: archives:>>>>>>>>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug>>>>>>>>>>>>>> Reporting: support@webdna.us >>>>>>>>>>>>>>>>>>>>>>>>>>>> --------------------------------------------------------->>>>>>>>>>>>>> This message is sent to you because you are>>>>>>>>>>>>>> subscribed to the mailing list . To unsubscribe,>>>>>>>>>>>>>> E-mail to: archives:>>>>>>>>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug>>>>>>>>>>>>>> Reporting: support@webdna.us >>>>>>>>>>>>>>>>>>>>>>>>>> --------------------------------------------------------->>>>>>>>>>>>> This message is sent to you because you are>>>>>>>>>>>>> subscribed to the mailing list . To unsubscribe,>>>>>>>>>>>>> E-mail to: archives:>>>>>>>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug>>>>>>>>>>>>> Reporting: support@webdna.us >>>>>>>>>>>>>>>>>>>>>>>> --------------------------------------------------------->>>>>>>>>>>> This message is sent to you because you are subscribed>>>>>>>>>>>> to the mailing list . To unsubscribe, E-mail to:>>>>>>>>>>>> archives: http://mail.webdna.us/list/talk@webdna.us>>>>>>>>>>>> Bug Reporting: support@webdna.us>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>> --------------------------------------------------------->>>>>>>>>>> This message is sent to you because you are subscribed>>>>>>>>>>> to the mailing list . To unsubscribe, E-mail to:>>>>>>>>>>> archives: http://mail.webdna.us/list/talk@webdna.us Bug>>>>>>>>>>> Reporting: support@webdna.us >>>>>>>>>>>>>>>>>>>> --------------------------------------------------------- This>>>>>>>>>> message is sent to you because you are subscribed to the>>>>>>>>>> mailing list . To unsubscribe, E-mail to: archives:>>>>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:>>>>>>>>>> support@webdna.us >>>>>>>>>>>>>>>>>> --------------------------------------------------------->>>>>>>>> This message is sent to you because you are subscribed to>>>>>>>>> the mailing list >.>>>>>>>>> To unsubscribe, E-mail to: >>>>>>>> >>>>>>>>>> archives: http://mail.webdna.us/list/talk@webdna.us>>>>>>>>> Bug Reporting: support@webdna.us >>>>>>>>>>>>>>>> --------------------------------------------------------->>>>>>>> This message is sent to you because you are subscribed to>>>>>>>> the mailing list . To unsubscribe, E-mail to: archives:>>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:>>>>>>>> support@webdna.us >>>>>>>>>>>>>> --------------------------------------------------------->>>>>>> This message is sent to you because you are subscribed to>>>>>>> the mailing list . To unsubscribe, E-mail to: archives:>>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:>>>>>>> support@webdna.us >>>>>>>>>>>> --------------------------------------------------------->>>>>> This message is sent to you because you are subscribed to>>>>>> the mailing list . To unsubscribe, E-mail to: archives:>>>>>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:>>>>>> support@webdna.us >>>>>>>>>> --------------------------------------------------------->>>>> This message is sent to you because you are subscribed to the>>>>> mailing list . To unsubscribe, E-mail to: archives:>>>>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:>>>>> support@webdna.us >>>>>>>> --------------------------------------------------------- This>>>> message is sent to you because you are subscribed to the>>>> mailing list . To unsubscribe, E-mail to: archives:>>>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:>>>> support@webdna.us >>>>>>> --------------------------------------------------------- This>> message is sent to you because you are subscribed to the mailing>> list . To unsubscribe, E-mail to: archives:>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:>> support@webdna.us >=20> --------------------------------------------------------- This> message is sent to you because you are subscribed to the mailing> list . To unsubscribe, E-mail to: archives:> http://mail.webdna.us/list/talk@webdna.us Bug Reporting:> support@webdna.us---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list .To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us.
Kenneth Grome
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
[shownext max=?] armed (1997)
WebCatalog/Mac 2.1b2 New Features (1997)
Tables (2005)
[numfound] in nested [search] (2000)
form crasehes server (1997)
[format 40s]text[/format] doesn't work (1997)
Silly date question (2006)
problems with WebCat-Plugin ()
AutoCommit Preference? (1998)
carriage returns in data (1997)
Who is doing sign-ups-got it (1998)
SendTo more emails (1998)
Fax Broadcast (1998)
For those of you not on the WebCatalog Beta... (1997)
Exchange rates (2000)
WebDNA-Talk Digest mode broken (1997)
search/showif issues (2000)
Need help with emailer- 2 issues (1997)
Pay Flo Pro (2002)
[WebDNA] 64-bit CentOS 6.3 (2013)