| Dart Home | PowerTCP Web for ActiveX | Custom Development | Reply | PowerTCP Web for ActiveX Topics | Forums |
| Author | Forum: PowerTCP Web for ActiveX Topic: Getting file that isn't there? |
| Rick From: Minnetonka, MN USA Posts: 9 Member Since: 12/06/05 |
posted December 7, 2005 1:25 PM When I try to get a file from a https site that doesn't exists it still gets it, but it's 1K. For example I want to get a zip file from a https site. I type in a wrong filename to test it, yet the file comes over as 1K and is not a valid zip file obviously. The only code I use is: https.Url = strFullpath https.Security = 17 https.Get strImportPath & strFilename, , "username", "pw" Is there a way to find out if a file exists, or better yet why is this returning a file that doesn't exists. Thanks. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted December 7, 2005 1:47 PM Have you had a chance to look at any of the sample apps yet? Try getting the same file with the PageFetch sample and you should see the error message. Now step through the code to the place where the error is displayed then work backwards and you should get an understanding of how it works. |
| Rick From: Minnetonka, MN USA Posts: 9 Member Since: 12/06/05 |
posted December 7, 2005 2:29 PM The Page Fetch program doesn't seem to work right with my example. I firt put in a file that exists and it tried to display it in the Content textbox. It's a .gz file. Then when I try a filename that doesn't exits, no real error is produced, the page it brings back is a 404 Not Found in the <title>. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted December 7, 2005 2:43 PM A gz file is binary. It will not display. The 404 page IS the error. That is the "1K file" that you are getting. You should probably delete the file if you get a response code of anything but 200. |
| Rick From: Minnetonka, MN USA Posts: 9 Member Since: 12/06/05 |
posted December 7, 2005 2:49 PM I thought it asks where to place the file if it's a binary file? It didn't ask me. It tried to display it, but just displayed junk characters. Also if it's a file how can I look for anything other than 200? My code I use just saves the file. Do I have to do something with headers? |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted December 7, 2005 3:03 PM If you take a look at the code in the CheckHeader function, you will see that the dialog comes up only when the content type contains 'application', 'image' or 'audio'. Evidently in your case, the content type is not one of those. What you want to check is Http.Status after the call to 'Head' or 'Get'. If you only call 'Get', then the response will be saved to the file you specified. In that case you would need to delete the file. |
| Reply | PowerTCP Web for ActiveX Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|