I have a classic ASP script that opens a URL and generates the .gif provided to the local machine - this is ran every hour via scheduled tasks to 'update' the gif appropriately. Here is ourfile.asp:
<%
'The URL to get our .gif returned
url = "http://api.ourweathersite.com/api/our/api/request"
'Create our xmlhttp request
set xmlhttp = Server.CreateObject("Msxml2.ServerXMLHTTP.6.0")
xmlhttp.open ("GET", url, false)
'Send our request
xmlhttp.send
'Create a binary stream of the request and save the .gif
With Server.CreateObject("Adodb.Stream")
.Type = 1 '1 for binary stream
.Open
.Write xmlhttp.responseBody
.SaveToFile Server.Mappath("\MyIISDirectory\mygif\myresponse.gif"), 2 ' 2 for overwrite
.Close
End With
set xmlhttp = nothing
%>
I need to convert this to ASP.NET as we've recently upgraded the server that hosts this (went from 2003 box to a 2012 box with ASP.NET).
What is the best way to go about this? Is there a way to get this classic ASP running on the newer box without converting to ASP.NET?
It's not a super complex task, but I haven't been able to find much online and just changing the extension to .aspx (as expected, but was suggested somewhere) doesn't work.
Is it necessary to completely rewrite this?