Re: [WebDNA] WebDNA AJAX_Fileuploader

This WebDNA talk-list message is from

2013


It keeps the original formatting.
numero = 110935
interpreted = N
texte = --Apple-Mail=_B116DB91-B31B-49F4-8608-C238027B5957 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 I think that you will find if you change your WebDNA prefs to not = require and remove it from the page it will work. The is what the parser is referring to in = 'unexpected character or unexpected keyword' as the parser reads = everything on the page and tries to parse the html comment but errors. Regards Stuart Tremain IDFK Web Developments AUSTRALIA webdna@idfk.com.au On 2 Dec 2013, at 1:22 pm, Nices Lists wrote: > Hey Stuart,=20 >=20 > Thanks.=20 >=20 > Well, I DO GET the files to upload=85 by using suffix .tpl = (Post_File.tpl - called from scripts.js) and adding = .=20 >=20 > (Post_File.tpl does not have to be an HTML compliant page,=20 > and can be any text file, with a .tpl suffix & = added, along with this webDNA code: >=20 > [formvariables][!] > [/!][Showif [URL][name][/URL]^pic][TEXT]_FILENAME=3D[MIDDLE = startafter=3DContent-Dispositionform-datanamepicfilename&endbefore=3DConte= nt-Typeapplicationoctet-stream][grep = search=3D[URL][^a-zA-Z0-9\._+-][/URL]&replace=3D][NAME][/grep][/MIDDLE][/T= EXT][/showif][!] > [/!][Showif [URL][name][/URL]^pic][WriteFile = Secure=3DF&File=3Duploads/[_FILENAME]][value][/WriteFile][/showif][!] > [/!][/formvariables][!] > [/!] >=20 > It will NOT function if the is missing.=20 >=20 > It seems no matter where or how I include the jQuery response = {"status":"File was uploaded Successfully"} >=20 > I still get the SyntaxError : JSON.parse: unexpected character or = unexpected keyword, and the Progress Bar freezes on the page where the = images have been dragged to. >=20 > If, however, I have a file (Post_File.dna, or .txt or .html (called = from scripts.js) with only {"status":"File was uploaded Successfully"},=20= >=20 > then JSON parses that info and I get the completed Progress Bar & = Green Check mark image indicating a successful image upload,=20 >=20 > however=85 NO IMAGE UPLOAD. >=20 > I have attempted to include {"status":"File was uploaded = Successfully"} into the Post_File page top and bottom, inside and = outside of code, also used: [RAW] tag, [SETMIMEHEADER], even a [Meta] = refresh tag, uncommented it for webDNA, nothing seems to work.=20 >=20 > Any ideas, a bit stumped=85=20 >=20 > Appreciate the help. >=20 > --Ravens >=20 >=20 > On Dec 1, 2013, at 5:23 PM, WebDNA wrote: >=20 >> Ravens >>=20 >> I haven't used WebStar since Macintosh version 9, so I can't advise = there. >>=20 >> Would you like to post the entire code for post_file.dna ? >>=20 >> If you are using the AJAX file uploader that I think you are, I have = it working on Windows & Linux, there were a few tweeks needed to get it = to work OK. >>=20 >>=20 >> Regards >>=20 >> Stuart Tremain >> IDFK Web Developments >> AUSTRALIA >> webdna@idfk.com.au >>=20 >>=20 >>=20 >>=20 >> On 1 Dec 2013, at 8:54 am, Nices Lists wrote: >>=20 >>> Hey Stuart, >>>=20 >>> Thanks.=20 >>>=20 >>> webDNA 6 Commerce Version=20 >>> WebSTAR V server >>> Mac OSX 10.2.8=20 >>>=20 >>> Well, eliminated the JSON syntax error, but ONLY when there is NO = webDNA code in the post_file.dna. (also changed suffix to .json - no = difference) >>>=20 >>> otherwise, when webDNA code is in the file, I get the JSON syntax = error.=20 >>>=20 >>> Get jQuery progress bar, and green check image that upload of image = is complete,=20 >>>=20 >>> JSON output appears to validate, but webDNA will NOT write file, so = NO upload of any files.=20 >>>=20 >>> Seems webDNA is NOT recognizing webDNA code, and JSON parses webDNA = code as a syntax error.=20 >>>=20 >>> Any ideas? >>>=20 >>> Thanks, >>>=20 >>> --Ravens >>>=20 >>>=20 >>> On Nov 29, 2013, at 3:01 PM, Stuart Tremain wrote: >>>=20 >>>> It could very well be a server issue where the server sees the file = at text/html not JSON. >>>>=20 >>>> A few options >>>>=20 >>>> 1 Ensure that your JSON output validates. >>>> 2. Make sure that is not at the top of your = page >>>> 3. Remove any 'white space' from your file by commenting out line = returns in your WebDNA. >>>> 4. Force the server to accept the post_file.dna as a JSON file by = adding [SETMIMEHEADER name=3DContent-Type&value=3Dapplication/json] at = the top of your template if a windows server. >>>> 5. Change the filename to .json and make sure that all your WebDNA = & server settings are correct. >>>> 6. If a linux server, alter webdna.conf add/alter this: >>>>=20 >>>> >>>> AddType text/html .tpl .dna ...newsuffix >>>> AddType application/json ...json >>>> >>>>=20 >>>> AddHandler webcatalog2-handler .tpl .tmpl .html .htm .dna ...json >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>> What platform is your WebDNA running on ? >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>> On 30 Nov 2013, at 5:43 am, Nices Lists wrote: >>>>=20 >>>>> Hey All, >>>>>=20 >>>>> Been awhile since I have posted=85=20 >>>>>=20 >>>>> getting back on the bike after some years... >>>>>=20 >>>>> Not able to get WebDNA AJAX_Fileuploader to successfully upload = image files.=20 >>>>>=20 >>>>> Keep getting SyntaxError: JSON.parse: unexpected keyword in JS = Console Errors panel. >>>>>=20 >>>>> I believe error is related to jQuery parsing the string from the = webDNA file - post_file.dna >>>>>=20 >>>>> [formvariables] >>>>> [Showif [URL][name][/URL]^pic][TEXT]_FILENAME=3D[MIDDLE = startafter=3DContent-Dispositionform-datanamepicfilename&endbefore=3DConte= nt-Typeapplicationoctet-stream][grep = search=3D[URL][^a-zA-Z0-9\._+-][/URL]&replace=3D][NAME][/grep][/MIDDLE][/T= EXT][/showif] >>>>> [Showif [URL][name][/URL]^pic][WriteFile = Secure=3DF&File=3Duploads/[_FILENAME]][value][/WriteFile][/showif] >>>>> [/Formvariables] >>>>> {"status":"File was uploaded successfuly!"} >>>>>=20 >>>>> Anyone? >>>>>=20 >>>>> Thanks, >>>>>=20 >>>>> --Ravens >>>>>=20 >>>>>=20 >>>>>=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 >>>>=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 >>>=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 >>=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 >=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 --Apple-Mail=_B116DB91-B31B-49F4-8608-C238027B5957 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 I = think that you will find if you change your WebDNA prefs to not require = <!--HAS_WEBDNA_TAGS--> and remove it from the page it will = work.

The <!--HAS_WEBDNA_TAGS--> is what the = parser is referring to in 'unexpected character or unexpected keyword' = as the parser reads everything on the page and tries to parse the html = comment but errors.



Regards

Stuart = Tremain
IDFK Web Developments
AUSTRALIA




On 2 Dec 2013, at 1:22 pm, Nices Lists <ravens@nices.com> = wrote:

Hey = Stuart, 

Thanks. 

We= ll, I DO GET the files to upload=85 by using suffix .tpl (Post_File.tpl = -  called from scripts.js) and = adding  <!--HAS_WEBDNA_TAGS-->. 

=
(Post_File.tpl does not have to be an HTML compliant = page, 
and can be any text file, with a .tpl suffix = & <!--HAS_WEBDNA_TAGS--> added, along with this webDNA = code:

[formvariables][!]
[/!][Show= if [URL][name][/URL]^pic][TEXT]_FILENAME=3D[MIDDLE = startafter=3DContent-Dispositionform-datanamepicfilename&endbefore=3DC= ontent-Typeapplicationoctet-stream][grep = search=3D[URL][^a-zA-Z0-9\._+-][/URL]&replace=3D][NAME][/grep][/MIDDLE= ][/TEXT][/showif][!]
[/!][Showif = [URL][name][/URL]^pic][WriteFile = Secure=3DF&File=3Duploads/[_FILENAME]][value][/WriteFile][/showif][!]<= /div>
[/!][/formvariables][!]
[/!]

It will NOT function if the <!--HAS_WEBDNA_TAGS--> is = missing. 

It seems no matter where or how = I include the jQuery response {"status":"File was uploaded = Successfully"}

I still get the SyntaxError : = JSON.parse: unexpected character or unexpected keyword, and the Progress = Bar freezes on the page where the images have been dragged = to.

If, however,  I have a file = (Post_File.dna, or .txt or .html (called from scripts.js) with = only {"status":"File was uploaded = Successfully"}, 

then JSON parses that = info and I get the completed Progress Bar & Green Check mark image = indicating a successful image = upload, 

however=85  NO IMAGE = UPLOAD.

I have attempted to = include {"status":"File was uploaded Successfully"} into the = Post_File page top and bottom, inside and outside of code, also used: = [RAW] tag, [SETMIMEHEADER], even a [Meta] refresh tag, uncommented it = for webDNA, nothing seems to work. 

Any = ideas, a bit stumped=85 

Appreciate the = help.

--Ravens


On Dec 1, 2013, at 5:23 PM, WebDNA wrote:

Ravens

I haven't used WebStar = since Macintosh version 9, so I can't advise = there.

Would you like to post the entire code = for post_file.dna ?

If you are using the AJAX = file uploader that I think you are, I have it working on Windows & = Linux, there were a few tweeks needed to get it to work = OK.


Regards

Stuart Tremain
IDFK = Web Developments
AUSTRALIA




On 1 Dec 2013, at 8:54 am, Nices Lists <ravens@nices.com> = wrote:

Hey = Stuart,

Thanks. 

webDNA = 6 Commerce Version 
WebSTAR V server
Mac OSX =  10.2.8 

Well, eliminated the JSON = syntax error, but ONLY when there is NO webDNA code in the = post_file.dna. (also changed suffix to .json - no = difference)

otherwise, when webDNA code is = in the file, I get the JSON syntax = error. 

Get jQuery progress bar, and green = check image that upload of image is = complete, 

JSON output appears to = validate, but webDNA will NOT write file, so NO upload of any = files. 

Seems webDNA is NOT recognizing = webDNA code, and JSON parses webDNA code as a syntax = error. 

Any = ideas?

Thanks,

--Ravens<= /div>


On Nov 29, 2013, at 3:01 PM, = Stuart Tremain wrote:

It = could very well be a server issue where the server sees the file at = text/html not JSON.

A few = options

1 Ensure that your JSON output = validates.
2. Make sure that <!--HAS_WEBDNA_TAGS--> is not at the top of = your page
3. Remove any 'white space' from your file by = commenting out line returns in your WebDNA.
4. Force the = server to accept the post_file.dna as a JSON file by adding = [SETMIMEHEADER name=3DContent-Type&value=3Dapplication/json] at the = top of your template if a windows server.
5. Change the = filename to .json and make sure that all your WebDNA & server = settings are correct.
6. If a linux server, alter webdna.conf = add/alter this:

<IfModule = mime_module>
AddType text/html .tpl .dna = ...newsuffix
AddType application/json = ...json
</IfModule>

AddHandler = webcatalog2-handler .tpl .tmpl .html .htm .dna = ...json




<= /div>
What platform is your WebDNA running on = ?





On 30 Nov 2013, at 5:43 am, Nices Lists = <ravens@nices.com> = wrote:

Hey All,

Been awhile since I have posted=85 =

getting back on the bike after some years...

Not able to = get WebDNA AJAX_Fileuploader to successfully upload image files. =

Keep getting SyntaxError: JSON.parse: unexpected keyword in JS = Console Errors panel.

I believe error is related to jQuery = parsing the string from  the webDNA file - =  post_file.dna

[formvariables]
[Showif = [URL][name][/URL]^pic][TEXT]_FILENAME=3D[MIDDLE = startafter=3DContent-Dispositionform-datanamepicfilename&endbefore=3DC= ontent-Typeapplicationoctet-stream][grep = search=3D[URL][^a-zA-Z0-9\._+-][/URL]&replace=3D][NAME][/grep][/MIDDLE= ][/TEXT][/showif]
[Showif [URL][name][/URL]^pic][WriteFile = Secure=3DF&File=3Duploads/[_FILENAME]][value][/WriteFile][/showif]
= [/Formvariables]
{"status":"File was uploaded = successfuly!"}

Anyone?

Thanks,

--Ravens


---------------------------------------------------------
This = message is sent to you because you are subscribed to
the mailing list = <talk@webdna.us>.
To = unsubscribe, E-mail to: <talk-leave@webdna.us>
archi= ves: http://mail.webdna.us/l= ist/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/l= ist/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/l= ist/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/l= ist/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/l= ist/talk@webdna.us Bug Reporting: support@webdna.us

= --Apple-Mail=_B116DB91-B31B-49F4-8608-C238027B5957-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] WebDNA AJAX_Fileuploader (Nices Lists 2013)
  2. Re: [WebDNA] WebDNA AJAX_Fileuploader (WebDNA 2013)
  3. Re: [WebDNA] WebDNA AJAX_Fileuploader (Nices Lists 2013)
  4. Re: [WebDNA] WebDNA AJAX_Fileuploader (WebDNA 2013)
  5. Re: [WebDNA] WebDNA AJAX_Fileuploader (Donovan Brooke 2013)
  6. Re: [WebDNA] WebDNA AJAX_Fileuploader (Nices Lists 2013)
  7. Re: [WebDNA] WebDNA AJAX_Fileuploader (Donovan Brooke 2013)
  8. Re: [WebDNA] WebDNA AJAX_Fileuploader (Nices Lists 2013)
  9. Re: [WebDNA] WebDNA AJAX_Fileuploader (Stuart Tremain 2013)
  10. [WebDNA] WebDNA AJAX_Fileuploader (Nices Lists 2013)
--Apple-Mail=_B116DB91-B31B-49F4-8608-C238027B5957 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 I think that you will find if you change your WebDNA prefs to not = require and remove it from the page it will work. The is what the parser is referring to in = 'unexpected character or unexpected keyword' as the parser reads = everything on the page and tries to parse the html comment but errors. Regards Stuart Tremain IDFK Web Developments AUSTRALIA webdna@idfk.com.au On 2 Dec 2013, at 1:22 pm, Nices Lists wrote: > Hey Stuart,=20 >=20 > Thanks.=20 >=20 > Well, I DO GET the files to upload=85 by using suffix .tpl = (Post_File.tpl - called from scripts.js) and adding = .=20 >=20 > (Post_File.tpl does not have to be an HTML compliant page,=20 > and can be any text file, with a .tpl suffix & = added, along with this webDNA code: >=20 > [formvariables][!] > [/!][Showif [url][name][/URL]^pic][text]_FILENAME=3D[MIDDLE = startafter=3DContent-Dispositionform-datanamepicfilename&endbefore=3DConte= nt-Typeapplicationoctet-stream][grep = search=3D[url][^a-zA-Z0-9\._+-][/URL]&replace=3D][NAME][/grep][/MIDDLE][/T= EXT][/showif][!] > [/!][Showif [url][name][/URL]^pic][WriteFile = Secure=3DF&File=3Duploads/[_FILENAME]][value][/WriteFile][/showif][!] > [/!][/formvariables][!] > [/!] >=20 > It will NOT function if the is missing.=20 >=20 > It seems no matter where or how I include the jQuery response = {"status":"File was uploaded Successfully"} >=20 > I still get the SyntaxError : JSON.parse: unexpected character or = unexpected keyword, and the Progress Bar freezes on the page where the = images have been dragged to. >=20 > If, however, I have a file (Post_File.dna, or .txt or .html (called = from scripts.js) with only {"status":"File was uploaded Successfully"},=20= >=20 > then JSON parses that info and I get the completed Progress Bar & = Green Check mark image indicating a successful image upload,=20 >=20 > however=85 NO IMAGE UPLOAD. >=20 > I have attempted to include {"status":"File was uploaded = Successfully"} into the Post_File page top and bottom, inside and = outside of code, also used: [raw] tag, [setmimeheader], even a [Meta] = refresh tag, uncommented it for webDNA, nothing seems to work.=20 >=20 > Any ideas, a bit stumped=85=20 >=20 > Appreciate the help. >=20 > --Ravens >=20 >=20 > On Dec 1, 2013, at 5:23 PM, WebDNA wrote: >=20 >> Ravens >>=20 >> I haven't used WebStar since Macintosh version 9, so I can't advise = there. >>=20 >> Would you like to post the entire code for post_file.dna ? >>=20 >> If you are using the AJAX file uploader that I think you are, I have = it working on Windows & Linux, there were a few tweeks needed to get it = to work OK. >>=20 >>=20 >> Regards >>=20 >> Stuart Tremain >> IDFK Web Developments >> AUSTRALIA >> webdna@idfk.com.au >>=20 >>=20 >>=20 >>=20 >> On 1 Dec 2013, at 8:54 am, Nices Lists wrote: >>=20 >>> Hey Stuart, >>>=20 >>> Thanks.=20 >>>=20 >>> webDNA 6 Commerce Version=20 >>> WebSTAR V server >>> Mac OSX 10.2.8=20 >>>=20 >>> Well, eliminated the JSON syntax error, but ONLY when there is NO = webDNA code in the post_file.dna. (also changed suffix to .json - no = difference) >>>=20 >>> otherwise, when webDNA code is in the file, I get the JSON syntax = error.=20 >>>=20 >>> Get jQuery progress bar, and green check image that upload of image = is complete,=20 >>>=20 >>> JSON output appears to validate, but webDNA will NOT write file, so = NO upload of any files.=20 >>>=20 >>> Seems webDNA is NOT recognizing webDNA code, and JSON parses webDNA = code as a syntax error.=20 >>>=20 >>> Any ideas? >>>=20 >>> Thanks, >>>=20 >>> --Ravens >>>=20 >>>=20 >>> On Nov 29, 2013, at 3:01 PM, Stuart Tremain wrote: >>>=20 >>>> It could very well be a server issue where the server sees the file = at text/html not JSON. >>>>=20 >>>> A few options >>>>=20 >>>> 1 Ensure that your JSON output validates. >>>> 2. Make sure that is not at the top of your = page >>>> 3. Remove any 'white space' from your file by commenting out line = returns in your WebDNA. >>>> 4. Force the server to accept the post_file.dna as a JSON file by = adding [SETMIMEHEADER name=3DContent-Type&value=3Dapplication/json] at = the top of your template if a windows server. >>>> 5. Change the filename to .json and make sure that all your WebDNA = & server settings are correct. >>>> 6. If a linux server, alter webdna.conf add/alter this: >>>>=20 >>>> >>>> AddType text/html .tpl .dna ...newsuffix >>>> AddType application/json ...json >>>> >>>>=20 >>>> AddHandler webcatalog2-handler .tpl .tmpl .html .htm .dna ...json >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>> What platform is your WebDNA running on ? >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>> On 30 Nov 2013, at 5:43 am, Nices Lists wrote: >>>>=20 >>>>> Hey All, >>>>>=20 >>>>> Been awhile since I have posted=85=20 >>>>>=20 >>>>> getting back on the bike after some years... >>>>>=20 >>>>> Not able to get WebDNA AJAX_Fileuploader to successfully upload = image files.=20 >>>>>=20 >>>>> Keep getting SyntaxError: JSON.parse: unexpected keyword in JS = Console Errors panel. >>>>>=20 >>>>> I believe error is related to jQuery parsing the string from the = webDNA file - post_file.dna >>>>>=20 >>>>> [formvariables] >>>>> [Showif [url][name][/URL]^pic][text]_FILENAME=3D[MIDDLE = startafter=3DContent-Dispositionform-datanamepicfilename&endbefore=3DConte= nt-Typeapplicationoctet-stream][grep = search=3D[url][^a-zA-Z0-9\._+-][/URL]&replace=3D][NAME][/grep][/MIDDLE][/T= EXT][/showif] >>>>> [Showif [url][name][/URL]^pic][WriteFile = Secure=3DF&File=3Duploads/[_FILENAME]][value][/WriteFile][/showif] >>>>> [/Formvariables] >>>>> {"status":"File was uploaded successfuly!"} >>>>>=20 >>>>> Anyone? >>>>>=20 >>>>> Thanks, >>>>>=20 >>>>> --Ravens >>>>>=20 >>>>>=20 >>>>>=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 >>>>=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 >>>=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 >>=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 >=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 --Apple-Mail=_B116DB91-B31B-49F4-8608-C238027B5957 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 I = think that you will find if you change your WebDNA prefs to not require = <!--HAS_WEBDNA_TAGS--> and remove it from the page it will = work.

The <!--HAS_WEBDNA_TAGS--> is what the = parser is referring to in 'unexpected character or unexpected keyword' = as the parser reads everything on the page and tries to parse the html = comment but errors.



Regards

Stuart = Tremain
IDFK Web Developments
AUSTRALIA




On 2 Dec 2013, at 1:22 pm, Nices Lists <ravens@nices.com> = wrote:

Hey = Stuart, 

Thanks. 

We= ll, I DO GET the files to upload=85 by using suffix .tpl (Post_File.tpl = -  called from scripts.js) and = adding  <!--HAS_WEBDNA_TAGS-->. 

=
(Post_File.tpl does not have to be an HTML compliant = page, 
and can be any text file, with a .tpl suffix = & <!--HAS_WEBDNA_TAGS--> added, along with this webDNA = code:

[/!][Show= if [url][name][/URL]^pic][text]_FILENAME=3D[MIDDLE = startafter=3DContent-Dispositionform-datanamepicfilename&endbefore=3DC= ontent-Typeapplicationoctet-stream][grep = search=3D[url][^a-zA-Z0-9\._+-][/URL]&replace=3D][NAME][/grep][/MIDDLE= ][/TEXT][/showif][!]
[/!][Showif = [url][name][/URL]^pic][WriteFile = Secure=3DF&File=3Duploads/[_FILENAME]][value][/WriteFile][/showif][!]<= /div>
[/!][/formvariables][!]
[/!]

It will NOT function if the <!--HAS_WEBDNA_TAGS--> is = missing. 

It seems no matter where or how = I include the jQuery response {"status":"File was uploaded = Successfully"}

I still get the SyntaxError : = JSON.parse: unexpected character or unexpected keyword, and the Progress = Bar freezes on the page where the images have been dragged = to.

If, however,  I have a file = (Post_File.dna, or .txt or .html (called from scripts.js) with = only {"status":"File was uploaded = Successfully"}, 

then JSON parses that = info and I get the completed Progress Bar & Green Check mark image = indicating a successful image = upload, 

however=85  NO IMAGE = UPLOAD.

I have attempted to = include {"status":"File was uploaded Successfully"} into the = Post_File page top and bottom, inside and outside of code, also used: = [raw] tag, [setmimeheader], even a [Meta] refresh tag, uncommented it = for webDNA, nothing seems to work. 

Any = ideas, a bit stumped=85 

Appreciate the = help.

--Ravens


On Dec 1, 2013, at 5:23 PM, WebDNA wrote:

Ravens

I haven't used WebStar = since Macintosh version 9, so I can't advise = there.

Would you like to post the entire code = for post_file.dna ?

If you are using the AJAX = file uploader that I think you are, I have it working on Windows & = Linux, there were a few tweeks needed to get it to work = OK.


Regards

Stuart Tremain
IDFK = Web Developments
AUSTRALIA




On 1 Dec 2013, at 8:54 am, Nices Lists <ravens@nices.com> = wrote:

Hey = Stuart,

Thanks. 

webDNA = 6 Commerce Version 
WebSTAR V server
Mac OSX =  10.2.8 

Well, eliminated the JSON = syntax error, but ONLY when there is NO webDNA code in the = post_file.dna. (also changed suffix to .json - no = difference)

otherwise, when webDNA code is = in the file, I get the JSON syntax = error. 

Get jQuery progress bar, and green = check image that upload of image is = complete, 

JSON output appears to = validate, but webDNA will NOT write file, so NO upload of any = files. 

Seems webDNA is NOT recognizing = webDNA code, and JSON parses webDNA code as a syntax = error. 

Any = ideas?

Thanks,

--Ravens<= /div>


On Nov 29, 2013, at 3:01 PM, = Stuart Tremain wrote:

It = could very well be a server issue where the server sees the file at = text/html not JSON.

A few = options

1 Ensure that your JSON output = validates.
2. Make sure that <!--HAS_WEBDNA_TAGS--> is not at the top of = your page
3. Remove any 'white space' from your file by = commenting out line returns in your WebDNA.
4. Force the = server to accept the post_file.dna as a JSON file by adding = [SETMIMEHEADER name=3DContent-Type&value=3Dapplication/json] at the = top of your template if a windows server.
5. Change the = filename to .json and make sure that all your WebDNA & server = settings are correct.
6. If a linux server, alter webdna.conf = add/alter this:

<IfModule = mime_module>
AddType text/html .tpl .dna = ...newsuffix
AddType application/json = ...json
</IfModule>

AddHandler = webcatalog2-handler .tpl .tmpl .html .htm .dna = ...json




<= /div>
What platform is your WebDNA running on = ?





On 30 Nov 2013, at 5:43 am, Nices Lists = <ravens@nices.com> = wrote:

Hey All,

Been awhile since I have posted=85 =

getting back on the bike after some years...

Not able to = get WebDNA AJAX_Fileuploader to successfully upload image files. =

Keep getting SyntaxError: JSON.parse: unexpected keyword in JS = Console Errors panel.

I believe error is related to jQuery = parsing the string from  the webDNA file - =  post_file.dna

[formvariables]
[Showif = [url][name][/URL]^pic][text]_FILENAME=3D[MIDDLE = startafter=3DContent-Dispositionform-datanamepicfilename&endbefore=3DC= ontent-Typeapplicationoctet-stream][grep = search=3D[url][^a-zA-Z0-9\._+-][/URL]&replace=3D][NAME][/grep][/MIDDLE= ][/TEXT][/showif]
[Showif [url][name][/URL]^pic][WriteFile = Secure=3DF&File=3Duploads/[_FILENAME]][value][/WriteFile][/showif]
= [/Formvariables]
{"status":"File was uploaded = successfuly!"}

Anyone?

Thanks,

--Ravens


---------------------------------------------------------
This = message is sent to you because you are subscribed to
the mailing list = <talk@webdna.us>.
To = unsubscribe, E-mail to: <talk-leave@webdna.us>
archi= ves: http://mail.webdna.us/l= ist/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/l= ist/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/l= ist/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/l= ist/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/l= ist/talk@webdna.us Bug Reporting: support@webdna.us

= --Apple-Mail=_B116DB91-B31B-49F4-8608-C238027B5957-- WebDNA

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:

Checkboxes (1998) FormVariable (1999) Email notification to one of multiple vendors ? (1997) Cybercash Problem with order (2001) Signal Raised Error (Part III) (1997) ANother SHOWIF problem (1997) multiple search commands (1997) America Online Issues (1998) Paranoid about serial numbers...not (1998) ignore this test (1999) Rhapsody? (1997) WC 2.0 frames feature (1997) Searching Numbers (2004) hideif/showif causes error if wrapped around searches (2003) Problems with [Search] param - Mac Plugin b15 (1997) Using Plug-In while running 1.6.1 (1997) WC2b15 - [HTMLx]...[/HTMLx] problems (1997) Mac System Experience (1998) creator code (1997) Re:need help please (1997)