PDA, Web, Desktop, GIS, Field Mapping, KML, UTM, Education, Cartoon

Mobile GIS Delphi Sql Server OpenSocial ASP.Net/C# Google KML RSS
Showing posts with label ASP. Show all posts
Showing posts with label ASP. Show all posts

Apr 16, 2008

ASP Error ‘ASP 0104: 80004005'


Solution:


Open IIS Manager


Right click on your local computer


In the Internet Information Service windows the very first checkbox is “Enable Direct Metabase Edit”.


Open your metabase.XML which is located in c:\Windows\System32\Inetsrv find the line “AspMaxRequestEntityAllowed” and change it to “1073741824″. (1GB)


(may need stop IIS first before modify)
or will be much better to modify with this:
Internet Information Services (IIS) 6.0 Resource Kit Tools:

Feb 20, 2008

Image downloading from remote servers in ASP

In this tutorial, we will access to a remote server, download image, rename ths image and save to our file system. We will use one function (getImage) and one subroutine (saveImage) to complete this sampel code.

First part of our code, get image byte array from remote server. Second part contains a subroutine that writes byte array to file system.

Lets's put our function and subroutine calls in the beginning of code.

Creating variables

imageUrl = "htp://www.some-domain-name.com/images/target-image.jpg"
strImageName = "new-image.jpg"



Function and subroutine calls

saveImage getImage(imageUrl), strImageName


Here is code library:

Function getImage(strImageUrl)
' Set objHttp = CreateObject("Microsoft.XMLHTTP")
' Set objHttp = CreateObject("MSXML2.ServerXMLHTTP")
Set objHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
' Set Http = CreateObject("WinHttp.WinHttpRequest")
objHttp.Open "GET", URL, False
objHttp.Send

getImage = getImageHttp.ResponseBody
End Function

Sub saveImage(ByteArray, strImageName)
Const adTypeBinary = 1
Const adSaveCreateOverWrite = 2
Const adSaveCreateNotExist = 1

Set objBinaryStream = CreateObject("ADODB.Stream")
objBinaryStream.Type = adTypeBinary

objBinaryStream.Open
objBinaryStream.Write ByteArray
objBinaryStream.SaveToFile "C:\Inetpub\wwwroot\dotnetindex.com\images\" & (strImageName), adSaveCreateOverWrite
response.Write("Image has been download and saved!")
end sub


Aim of this article, to be a reference how to download bytes from remote servers. You may use this source code after adding some error controlling to sample code.