Jump to content
Sign in to follow this  
Klassieker

inetget and using a large variable

Recommended Posts

Klassieker

Does somebody know if you are using inetget($url, "c:\temp\test.xml", 1,1) behave differently if you use instead of $url the real webaddres, if it is a large string of more then hundred characters?

If i use the real webaddres, i can download the file, but if i use the variable, it doesn't download the complete file, but i get error 2, no such service in xml file.

If i print the $url and compare the string with the real webaddres, i can't see anything different.

Thanks in advance

Klassieker

Share this post


Link to post
Share on other sites
JohnOne

It should not behave any differently to the best of my knowledge.

EDIT:

But you might try url encoding the address before storing in a variable.

EDIT2:

"i get error 2, no such service in xml file" InetGet gives no such error, at least in help file, where did you get this info?

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
Klassieker

Well it does, I can't figure it out why.

I read a section in a ini file and store the information for the key in a variable,

like

$section = the section to go to, $section2 = the filename and path (e.g. "c:temptest.xml")

Local $sdownloadurl = IniReadSection(@ScriptDir & "test.ini" , $section)

Local $sdownloadfile = IniReadSection(@ScriptDir & "test.ini" , $section2)

The key will be $sdownloadurl[1][1] and this will be stored in another variable $var2 (more than 100 characters)

The key $sdownloadfile will be stored in another variable ($var3)

when I use InetGet($var2, $var3,1,1) , it won't work

When I copy the data of the string $sdownloadurl[1][1] in $var4 (without using the ini file), and copy the string $sdownloadfile[1][1] in $var5, also without the use of the ini file, it works fine.

I tried this with the sample script to get a xml file from autoit it works with the ini, maybe because the used caracters are less than my string.

I would like to give my example script, but I use an API key to get information of my monitoring system.

I don't get a file directly from the monitoring system, but I download the xml code I get back from the monitoring system into a file.

like "https://wwwsitidformonitoring.com/api/?apikey=fff8889dke89erreurkjir89r89re8dfhjfri7r87r86743563245141251b19d&service=list_clients"

Error 2 is given back from the monitoring system.

Maybe inetget is not the right function for the job?

Edited by Klassieker

Share this post


Link to post
Share on other sites
Klassieker

Problem Solved

When I declare a string variable, I use " ".

So I used " " also in the ini file.

Don't using them in the ini solved the problem.

Thanks for the help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×