Sign in to follow this  
Followers 0
redndahead

Inetget Issue

10 posts in this topic

Moving off of a previous thread Valik you said you have more to do to the InetGet(). May I ask what it is?

I have a current issue that I can't seem to get fixed.

My script will look like this.

$FileSize = InetGetSize('http://user:password@mysite.com/subsite/filename.cab')
$Inetcheck = InetGet('http://user:password@mysite.com/subsite/filename.cab', 'c:\')
MsgBox(0,'',$FileSize & @CRLF & $InetCheck)

$FileSize will return the correct file size, but $InetCheck will return 0 and not download the file. Am I missing something?

red

Share this post


Link to post
Share on other sites



Moving off of a previous thread Valik you said you have more to do to the InetGet(). May I ask what it is?

I have a current issue that I can't seem to get fixed.

My script will look like this.

$FileSize = InetGetSize('http://user:password@mysite.com/subsite/filename.cab')
$Inetcheck = InetGet('http://user:password@mysite.com/subsite/filename.cab', 'c:\')
MsgBox(0,'',$FileSize & @CRLF & $InetCheck)

$FileSize will return the correct file size, but $InetCheck will return 0 and not download the file. Am I missing something?

red

Just a piece of advice, don't ever ask me to look at a problem without a full reproduction recipe with a high rate of failure. It's rare that I will write code to fix problems I'm only guessing at. If you can provide information so that I can reproduce a problem, I will look at things but I'm not going to shoot in the dark at stuff.

One thing that I see that is stupid is you use a string literal twice. I don't care if it was just an "example", if you use a string in more than one location, it should be in a variable, period. Otherwise, your chances of making a typo scale in a linear fashion. Even in examples you should use variables when appropriate instead of string literals. Based on the example alone, I'm inclined to say that in your real code, the URL in InetGetSize() is different (and correct) from the one in InetGet().

As for what changes I have made, all the user-visible changes are publicly available in the changelog and I've discussed most everything in the various InetGet() threads.

Share this post


Link to post
Share on other sites

Valik,

First don't treat me like a newbie. I have been here much longer than you. I know how to write a script.

Secondly. There is your example. I do not have a website you can test as this is internal authentication. If I use curl this works. So I was thinking there might be a limitation to the inetget() function when authenticating. I'm sorry I can't give you a server to test it with, but that is the script plain and simple.

Inetgetsize() works

inetget() doesn't.

Is there a reason a web server would let you get the size of the file but not download it?

Third: I didn't state the previous thread so here it is.

http://www.autoitscript.com/forum/index.ph...=ST&f=2&t=24850

In that you say:

I have more work to do on InetGet() but the changes should be in the next version of AutoIt and no later than 2 versions away.

So my hope was that whatever the "more work" is may help the problem I am having.

red

Share this post


Link to post
Share on other sites

Valik,

First don't treat me like a newbie. I have been here much longer than you. I know how to write a script.

Then don't act like one. Either post useful information or don't post at all. You'd be hard pressed to provide a more generic problem description than what you did. You haven't even provided a single version of AutoIt you are using to test this, either. Versions 3.1.1.0, 3.1.1.94, 3.1.1.95, 3.1.1.108, 3.1.1.119, and 3.1.1.120 all have different versions of InetGet() in them based on the changelog.

Secondly. There is your example. I do not have a website you can test as this is internal authentication. If I use curl this works. So I was thinking there might be a limitation to the inetget() function when authenticating. I'm sorry I can't give you a server to test it with, but that is the script plain and simple.

I'm sorry, I still haven't gotten my crystal ball back (reference to a comment I made in another thread about InetGet()).

Inetgetsize() works

inetget() doesn't.

Is there a reason a web server would let you get the size of the file but not download it?

Cookies?

Third: I didn't state the previous thread so here it is.

http://www.autoitscript.com/forum/index.ph...=ST&f=2&t=24850

In that you say:

So my hope was that whatever the "more work" is may help the problem I am having.

red

Nobody had reported any problem with downloading files. All my work has been centered around making sure InetGet() does not block the foreground thread when it's run in the background (and fixing small bugs I introduced as a result of more complicated threading). I have made no changes to the actual downloading process. As I stated previously, I can't fix problems I can't see and nobody has mentioned any legitimate problems with InetGet() (that I remember) in the last several months except for the blocking issue which has been my focus of late.

Share this post


Link to post
Share on other sites

Actually:

That was from this forum, there was on before that I believe, so who knows :think:.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

$fileSize = InetGetSize('http://user:password@mysite.com/subsite/filename.cab')

$Inetcheck = InetGet('http://user:password@mysite.com/subsite/filename.cab' 'c:\')

MsgBox(0,'',$FileSize & @CRLF & $InetCheck)

should it be

$fileSize = InetGetSize('http://user:password@mysite.com/subsite/filename.cab')
$Inetcheck = InetGet('http://user:password@mysite.com/subsite/filename.cab', 'c:\filename.cab')
MsgBox(0,'',$FileSize & @CRLF & $InetCheck)

?

Edited by rambo3889

My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! you’re the best in town Fight!

Share this post


Link to post
Share on other sites

should it be

$fileSize = InetGetSize('http://user:password@mysite.com/subsite/filename.cab')
$Inetcheck = InetGet('http://user:password@mysite.com/subsite/filename.cab', 'c:\filename.cab')
MsgBox(0,'',$FileSize & @CRLF & $InetCheck)

?

Yep, that's it, I just tried:

MsgBox(0,"",InetGet("http://www.google.com", "C:\"))
MsgBox(0,"",InetGet("http://www.google.com", "C:\test.htm"))

The first returns 0 and the second returns 1.

@SmOke_N: Yeah, I realize that probably was the case, especially with no rebuttal from Valik. I just thought I would post it for it's comical value.


[u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia

Share this post


Link to post
Share on other sites

Okay


My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! you’re the best in town Fight!

Share this post


Link to post
Share on other sites

It needs documented that a filename is required for the local file if that is the case.

redndahead, this is why you absolutely must post real examples and not contrived examples. I never gave much thought to requiring a local file name because:

  • I didn't know it was required in the first place.
  • The rest of the example was bogus so the local path without filename didn't stand out.
After all, since you're not a newbie and know how to write a script, I might not have pointed it out even if I had known about the limitation to the function. All the more reason to post real examples.

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  
Followers 0