Re: tsneterr: (3) URL using bad/illegal format or missing URL

2023-12-17 Thread Klaus major-k via use-livecode
Hi Matthias,

thank you very much!

Since Alex already spotted my problem, I will store this for future reference.

> Am 17.12.2023 um 12:45 schrieb matthias rebbe via use-livecode 
> :
> 
> Hello Klaus.
> 
> please see the example below. In my example i am posting a zip file with 
> images to a livecode server script
> Livecode script
> on mouseup
>  ...
> I hope there is no error in my example. I simplified my original code for the 
> above example.
> 
> In my original version the complete upload and the processing of the uploaded 
> file is automatic w/o user interaction. 
> The desktop app creates a zip file and posts that zip file to a Livecode 
> Server script which just handles the upload and then returns a success or 
> failure.
> According to the upload script my standalone then calls another script on the 
> server for further processing.
> 
> Regards,
> Matthias

Best

Klaus

--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: tsneterr: (3) URL using bad/illegal format or missing URL

2023-12-17 Thread matthias rebbe via use-livecode
Hello Klaus.

please see the example below. In my example i am posting a zip file with images 
to a livecode server script

Livecode script

on mouseup
   answer file "Select zip file..."
   if it is empty then exit to top
   put "" & it into tArchive
   if libUrlMultiPartFormData(tForm,"Archive", tArchive) is not empty then
  altlog the long system time & " - error:" & it
   else
  set the httpHeaders to line 1 of tForm 
  altlog the long system time & " - Upload gestartet"
  post line 2 to -1 of tForm to url "https://MYSERVER.COM/upload_bilder.lc;
  put it into  postResult
  set the httpHeaders to empty
  
  switch postResult
 case   postResult begins with "Bildupload fehlgeschlagen" is true
 ## your script for upload error
 break
 case  postResult begins with "Bildupload okay" is true
 ## your script for successful upload
break
end switch
   end if
end mouseup 


Livecode Server script



I hope there is no error in my example. I simplified my original code for the 
above example.

In my original version the complete upload and the processing of the uploaded 
file is automatic w/o user interaction. 
The desktop app creates a zip file and posts that zip file to a Livecode Server 
script which just handles the upload and then returns a success or failure.
According to the upload script my standalone then calls another script on the 
server for further processing.


Regards,
Matthias




> Am 17.12.2023 um 10:18 schrieb Klaus major-k via use-livecode 
> :
> 
> Hi Matthias,
> 
>> Am 16.12.2023 um 23:29 schrieb matthias rebbe via use-livecode 
>> :
>> 
>> Hello Klaus,
>> 
>> You could try to post the data as a file  to the server. There is an array 
>> $_files in Livecode server available, which handles the file uploads.
> 
> ah, sounds promising, thank you! :-)
> I wanted to post the list directly from an LC field, but can surely store its 
> content to a temp file.
> 
> But how is the syntax in my case?
> ...
> put clean_name(tSetlist) into tDateiname 
> ## = filename on server
> 
> ## put "whatever" & CR & urlencode(fld "setlist") into tInhalt
> put "https://www.MYSERVER.de/setlists.lc?name=; & tDateiname & "=" & 
> url("file:" & path to file") into tURL #?
> ## Nothing in the dictionary about this
> ...
> 
>> Regards,
>> Matthias
> 
> Best
> 
> Klaus
> 
> --
> Klaus Major
> https://www.major-k.de
> https://www.major-k.de/bass
> kl...@major-k.de
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: tsneterr: (3) URL using bad/illegal format or missing URL

2023-12-17 Thread Klaus major-k via use-livecode
Hi Alex,

> Am 17.12.2023 um 12:22 schrieb Alex Tweedly via use-livecode 
> :
> 
> 
> On 16/12/2023 14:51, Klaus major-k via use-livecode wrote:
>> Hi friends,
>> 
>> I am trying to upload a (not so long) urlencoded text list
>> to my server, but get the tsNet error as in the subject.
>> 
>> In the form of:
>> ...
>> ## Remove spaces etc.
>> put clean_name(tSetlist) into tDateiname
>> put "whatever" & CR & urlencode(fld "setlist") into tInhalt
>> put "https://www.MYSERVER.de/setlists.lc?name=; & tDateiname & "=" & 
>> tInhalt into tUrl
>> ...
>> ...
>> 
>> The error comes from LC and NOT from the server, tAnwort = EMPTY!
>> 
>> The URL is definitively correct!
>> Is the urlencoded string in tInhalt too long for a parameter?
>> Or is a CR in that parameter not a good idea?
> 
> The CR in the parameter is a bad idea.
> 
> Instead of
> put "whatever" & CR & urlencode(fld "setlist") into tInhalt
> would you not be better doing
> put urlencode("whatever"  & fld "setlist") into tInhalt
> (I can't reproduce the error here, so I can't be sure if this fixes it or not 
> - but the CR in the url is definitely a bad idea).

YES, that did the trick, thank you very much!
Have a nice sunday!

> Alex.

Best

Klaus

--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: tsneterr: (3) URL using bad/illegal format or missing URL

2023-12-17 Thread Alex Tweedly via use-livecode



On 16/12/2023 14:51, Klaus major-k via use-livecode wrote:

Hi friends,

I am trying to upload a (not so long) urlencoded text list
to my server, but get the tsNet error as in the subject.

In the form of:
...
## Remove spaces etc.
put clean_name(tSetlist) into tDateiname
put "whatever" & CR & urlencode(fld "setlist") into tInhalt
put "https://www.MYSERVER.de/setlists.lc?name=; & tDateiname & "=" & 
tInhalt into tUrl
...
...

The error comes from LC and NOT from the server, tAnwort = EMPTY!

The URL is definitively correct!
Is the urlencoded string in tInhalt too long for a parameter?
Or is a CR in that parameter not a good idea?


The CR in the parameter is a bad idea.

Instead of

put "whatever" & CR & urlencode(fld "setlist") into tInhalt

would you not be better doing

put urlencode("whatever"  & fld "setlist") into tInhalt


(I can't reproduce the error here, so I can't be sure if this fixes it 
or not - but the CR in the url is definitely a bad idea).



Alex.



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: tsneterr: (3) URL using bad/illegal format or missing URL

2023-12-17 Thread Klaus major-k via use-livecode
Hi Matthias,

> Am 16.12.2023 um 23:29 schrieb matthias rebbe via use-livecode 
> :
> 
> Hello Klaus,
> 
> You could try to post the data as a file  to the server. There is an array 
> $_files in Livecode server available, which handles the file uploads.

ah, sounds promising, thank you! :-)
I wanted to post the list directly from an LC field, but can surely store its 
content to a temp file.

But how is the syntax in my case?
...
put clean_name(tSetlist) into tDateiname 
## = filename on server

## put "whatever" & CR & urlencode(fld "setlist") into tInhalt
put "https://www.MYSERVER.de/setlists.lc?name=; & tDateiname & "=" & 
url("file:" & path to file") into tURL #?
## Nothing in the dictionary about this
...

> Regards,
> Matthias

Best

Klaus

--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: tsneterr: (3) URL using bad/illegal format or missing URL

2023-12-16 Thread matthias rebbe via use-livecode
Hello Klaus,

You could try to post the data as a file  to the server. There is an array 
$_files in Livecode server available, which handles the file uploads.

Regards,
Matthias

> Am 16.12.2023 um 17:37 schrieb Klaus major-k via use-livecode 
> :
> 
> Should I use a different format to pass the CR delimited list to the LC 
> script?
> If yes, which one?
> 
>> Am 16.12.2023 um 16:50 schrieb Klaus major-k via use-livecode 
>> :
>> 
>> Followup:
>> I checked fo "illegal" character like @ ' etc., still no joy.
>> This has been working two weeks ago!
>> 
>>> Am 16.12.2023 um 15:51 schrieb Klaus major-k via use-livecode 
>>> :
>>> 
>>> Hi friends,
>>> 
>>> I am trying to upload a (not so long) urlencoded text list
>>> to my server, but get the tsNet error as in the subject.
>>> 
>>> In the form of:
>>> ...
>>> ## Remove spaces etc.
>>> put clean_name(tSetlist) into tDateiname
>>> put "whatever" & CR & urlencode(fld "setlist") into tInhalt
>>> put "https://www.MYSERVER.de/setlists.lc?name=; & tDateiname & "=" 
>>> & tInhalt into tUrl
>>> ...
>>> 
>>> The LC server script:
>>> -
>>> >> put $_GET["name"] into tName
>>> put $_GET["setlist"] into tSetList
>>> put "OK" into tAntwort
>>> try
>>> put tSetList into url("file:" & tName)
>>> catch tProblem
>>> put tProblem into tAntwort
>>> end try
>>> put tAntwort
>>> ?>
>>> 
>>> 
>>> The error comes from LC and NOT from the server, tAnwort = EMPTY!
>>> 
>>> The URL is definitively correct!
>>> Is the urlencoded string in tInhalt too long for a parameter?
>>> Or is a CR in that parameter not a good idea?
>>> 
>>> Any hints very appreciated, thanks in advance.
>>> 
>>> 
>>> Best
>>> 
>>> Klaus
>>> --
>>> Klaus Major
>>> https://www.major-k.de
>>> https://www.major-k.de/bass
>>> kl...@major-k.de
>>> 
>>> 
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> --
>> Klaus Major
>> https://www.major-k.de
>> https://www.major-k.de/bass
>> kl...@major-k.de
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> --
> Klaus Major
> https://www.major-k.de
> https://www.major-k.de/bass
> kl...@major-k.de
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: tsneterr: (3) URL using bad/illegal format or missing URL

2023-12-16 Thread Klaus major-k via use-livecode
Should I use a different format to pass the CR delimited list to the LC script?
If yes, which one?

> Am 16.12.2023 um 16:50 schrieb Klaus major-k via use-livecode 
> :
> 
> Followup:
> I checked fo "illegal" character like @ ' etc., still no joy.
> This has been working two weeks ago!
> 
>> Am 16.12.2023 um 15:51 schrieb Klaus major-k via use-livecode 
>> :
>> 
>> Hi friends,
>> 
>> I am trying to upload a (not so long) urlencoded text list
>> to my server, but get the tsNet error as in the subject.
>> 
>> In the form of:
>> ...
>> ## Remove spaces etc.
>> put clean_name(tSetlist) into tDateiname
>> put "whatever" & CR & urlencode(fld "setlist") into tInhalt
>> put "https://www.MYSERVER.de/setlists.lc?name=; & tDateiname & "=" & 
>> tInhalt into tUrl
>> ...
>> 
>> The LC server script:
>> -
>> >  put $_GET["name"] into tName
>>  put $_GET["setlist"] into tSetList
>>  put "OK" into tAntwort
>>  try
>>  put tSetList into url("file:" & tName)
>>  catch tProblem
>>  put tProblem into tAntwort
>>  end try
>>  put tAntwort
>> ?>
>> 
>> 
>> The error comes from LC and NOT from the server, tAnwort = EMPTY!
>> 
>> The URL is definitively correct!
>> Is the urlencoded string in tInhalt too long for a parameter?
>> Or is a CR in that parameter not a good idea?
>> 
>> Any hints very appreciated, thanks in advance.
>> 
>> 
>> Best
>> 
>> Klaus
>> --
>> Klaus Major
>> https://www.major-k.de
>> https://www.major-k.de/bass
>> kl...@major-k.de
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> --
> Klaus Major
> https://www.major-k.de
> https://www.major-k.de/bass
> kl...@major-k.de
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: tsneterr: (3) URL using bad/illegal format or missing URL

2023-12-16 Thread Klaus major-k via use-livecode
Followup:
I checked fo "illegal" character like @ ' etc., still no joy.
This has been working two weeks ago!

> Am 16.12.2023 um 15:51 schrieb Klaus major-k via use-livecode 
> :
> 
> Hi friends,
> 
> I am trying to upload a (not so long) urlencoded text list
> to my server, but get the tsNet error as in the subject.
> 
> In the form of:
> ...
> ## Remove spaces etc.
> put clean_name(tSetlist) into tDateiname
> put "whatever" & CR & urlencode(fld "setlist") into tInhalt
> put "https://www.MYSERVER.de/setlists.lc?name=; & tDateiname & "=" & 
> tInhalt into tUrl
> ...
> 
> The LC server script:
> -
>put $_GET["name"] into tName
>   put $_GET["setlist"] into tSetList
>   put "OK" into tAntwort
>   try
>   put tSetList into url("file:" & tName)
>   catch tProblem
>   put tProblem into tAntwort
>   end try
>   put tAntwort
> ?>
> 
> 
> The error comes from LC and NOT from the server, tAnwort = EMPTY!
> 
> The URL is definitively correct!
> Is the urlencoded string in tInhalt too long for a parameter?
> Or is a CR in that parameter not a good idea?
> 
> Any hints very appreciated, thanks in advance.
> 
> 
> Best
> 
> Klaus
> --
> Klaus Major
> https://www.major-k.de
> https://www.major-k.de/bass
> kl...@major-k.de
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


tsneterr: (3) URL using bad/illegal format or missing URL

2023-12-16 Thread Klaus major-k via use-livecode
Hi friends,

I am trying to upload a (not so long) urlencoded text list
to my server, but get the tsNet error as in the subject.

In the form of:
...
## Remove spaces etc.
put clean_name(tSetlist) into tDateiname
put "whatever" & CR & urlencode(fld "setlist") into tInhalt
put "https://www.MYSERVER.de/setlists.lc?name=; & tDateiname & "=" & 
tInhalt into tUrl
...

The LC server script:
-



The error comes from LC and NOT from the server, tAnwort = EMPTY!

The URL is definitively correct!
Is the urlencoded string in tInhalt too long for a parameter?
Or is a CR in that parameter not a good idea?

Any hints very appreciated, thanks in advance.


Best

Klaus
--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode