AutoHotkey Community

It is currently May 27th, 2012, 9:14 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 228 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11 ... 16  Next
Author Message
 Post subject:
PostPosted: October 21st, 2011, 5:36 pm 
Offline

Joined: October 19th, 2011, 10:11 pm
Posts: 5
[VxE] wrote:
My bad, I didn't even check to see if those functions returned without errors. This is how it should be:
Code:
   If DllCall( "WinINet\InternetQueryOption" WorA, pty, hRequest, "UInt", 31, "UInt*", pos, "UInt*", 4 )
      DllCall( "WinINet\InternetSetOption" WorA, pty, hRequest, "UInt", 31, "UInt*", pos |= 0x100, "UInt*", 4 )


Hey, Good news is I'm no longer getting the cert error. It's now returning error 12019 - ERROR_INTERNET_INCORRECT_HANDLE_STATE


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 22nd, 2011, 2:42 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
That's great news!.... but I don't know which function is giving you that error ; I can't seem to reproduce it :cry: :wink:

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 23rd, 2011, 12:18 am 
Offline

Joined: December 26th, 2010, 7:40 pm
Posts: 4172
Location: Awesometown, USA
[VxE], now I am totally confused. What I said "works" before works, but not for .jpg's created by gdip_SaveBitmapToFile.
Here is a sample image: http://www.autohotkey.net/~crazyfirex/img_003.jpg


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 23rd, 2011, 10:02 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
nimda, I'm not sure I can give more help than what the error response from imageshack contains.

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 23rd, 2011, 5:34 pm 
Offline

Joined: December 26th, 2010, 7:40 pm
Posts: 4172
Location: Awesometown, USA
It says that the file type isn't supported. But the file type is still .jpg, and the mimetype is correct :?
imageshack's web interface accepts it

_________________
Autofire, AutoClick, Toggle, SpamWindow Control Tools
Recommended: AutoHotkey_L


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2011, 11:03 pm 
Offline
User avatar

Joined: February 7th, 2005, 9:32 am
Posts: 71
I'm attempting to make a mass downloading app with this for Deviantart.
The URL for downloading any type of content usually looks like:
http://www.deviantart.com/download/id number here/

For example, in Firefox, if you follow this link:
http://www.deviantart.com/download/123555318/
it will get a 302 Moved in the header and get redirected to:
http://fc06.deviantart.net/fs45/f/2009/ ... Pureav.jpg

My problem is that I need to be able to get this second URL from that redirect in order to name the file properly. But every time I try to use that first URL above with HTTPRequest Deviantart always returns a 200 instead of a 302 for the header. Is possible to have HTTPRequest get a 302 and store the url it's redirected to so I could rename the file after it's downloaded?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 25th, 2011, 12:09 am 
Offline
User avatar

Joined: February 7th, 2005, 9:32 am
Posts: 71
Okay, I had a look around the forum and saw that I needed to set an Internet flag for that or two for that:
Code:
ops=
   ( LTRIM C
       +Flag: INTERNET_FLAG_NO_COOKIES
       +NO_AUTO_REDIRECT
       +IGNORE_REDIRECT_TO_HTTP
   )


Works like magic now! :lol:
I just parse the header and there's the filename!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 3rd, 2011, 8:49 pm 
Offline

Joined: November 3rd, 2011, 8:45 pm
Posts: 16
Great function, thank you very much.
There is, however, a bug that occurs when I try to use a proxy. You need to change:
Code:
            Else If ( options = "Proxy" ) ; use a proxy (don't bother checking the URL validity)
               proxy_url := A_LoopField, iOpenType := 3
to
Code:
            Else If ( options = "Proxy" ) ; use a proxy (don't bother checking the URL validity)
               proxy_url := A_LoopField, iOpenType := 3, bUseProxy := 1
Then, everything will work fine.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 4th, 2011, 3:40 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
nion wrote:
Great function, thank you very much.
There is, however, a bug that occurs when I try to use a proxy. You need to change:
Code:
            Else If ( options = "Proxy" ) ; use a proxy (don't bother checking the URL validity)
               proxy_url := A_LoopField, iOpenType := 3
to
Code:
            Else If ( options = "Proxy" ) ; use a proxy (don't bother checking the URL validity)
               proxy_url := A_LoopField, iOpenType := 3, bUseProxy := 1
Then, everything will work fine.

*fixed* Thanks for spotting the bug. :wink:

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2011, 8:28 pm 
Offline

Joined: February 26th, 2011, 7:14 pm
Posts: 22
I wanted to know if your function allows for comet-style programming where long polling is used for receiving messages. I'm trying to convert some code into AHK_L. Here's a link to a page that has something similar and was wondering if you can help:

http://stackoverflow.com/questions/4534 ... s-no-value

Any ideas?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 8th, 2011, 3:40 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
r7393s wrote:
I wanted to know if your function allows for comet-style programming where long polling is used for receiving messages. I'm trying to convert some code into AHK_L. Here's a link to a page that has something similar and was wondering if you can help:

http://stackoverflow.com/questions/4534 ... s-no-value

Any ideas?

Sorry, that's beyond my experience. It looks like you'll need to handle the HTTP transaction asynchronously (that's only my guess).

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 8th, 2011, 10:25 am 
Offline

Joined: February 20th, 2008, 5:08 pm
Posts: 111
[VxE] wrote:
oauth has been on the back burner as I take on other endeavors. Was there a particular API you have in mind?

Would you please be so kind as to publish the code for popular services like flickr and photobucket?

_________________
My scripts: http://apps.nozavi.com


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 30th, 2011, 10:07 am 
Offline

Joined: December 7th, 2005, 8:29 am
Posts: 345
Hi,

I have the weirdest bug.

I am using HTTPRequest when using it from a computer connected to the internet with windows 7 x64 bit SP1 fully updated, and it works like a charm!

A working XML and the response:
Image


My problem is that when I run the application I wrote in my work computer
Which is a win 7 x64 sp1 fully updated
I get some weird bug when trying to use HTTPRequest i get an error that looks like gibberish I tried several computers with the same result.

This is the error i Get:
Image

This is the same compiled EXE running on both computers
:shock: what is going on?!

Maybe the way the HTTPRequest function works may be different on some computers?

Please help :(

_________________
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 1st, 2011, 1:41 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
It looks like HTTPRequest isn't converting the XML response from UTF-8 to wide-char format. That can happen if the response headers don't include the 'charset' attribute of the 'content-type' header.

To fix the issue, add the "binary" option in each call to HTTPRequest and use StrPut() to convert the downloaded data from UTF-8 to wide-chars.

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 1st, 2011, 10:32 am 
Offline

Joined: December 7th, 2005, 8:29 am
Posts: 345
[VxE] wrote:
It looks like HTTPRequest isn't converting the XML response from UTF-8 to wide-char format. That can happen if the response headers don't include the 'charset' attribute of the 'content-type' header.

To fix the issue, add the "binary" option in each call to HTTPRequest and use StrPut() to convert the downloaded data from UTF-8 to wide-chars.


Hi,

Thank you for your help.

I use HTTPRequest to send an SMS using an API provided to me.

My problem here is that when running the same compiled exe the SMS are being sent, and in the LAN the SMS are not being sent.

Which means that the request it self is not being delivered at all.

So I dont think we have a problem in the response header because we dont have any response from the other side.


Sorry for your trouble, and thanks for your help,
Twhyman

_________________
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 228 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11 ... 16  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Rajat, SKAN and 8 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group