Thanks - I think I'm getting the picture. I did wonder how come a server side application could depend on the browser...now I know why I was getting confused if it can be used client side as well!
| SitePoint Sponsor |
Thanks - I think I'm getting the picture. I did wonder how come a server side application could depend on the browser...now I know why I was getting confused if it can be used client side as well!
I am trying to upload a file on my web server to another website using XMLHTTP. My code logs onto the other website automatically and navigates threw about 4 pages to the file upload screen. If I were trying to post regular form data to the site it would work fine, but I have to some how mimic the <input type=file> box and enctype=”multipart/form-data” parameter of the form within the XMLHTTP post. I am pretty sure I have to turn the file on my server into a binary stream and send it to the website. Does anyone know how to accomplish this?





This is an excellent resource.
I tried out this script
And it works just as i would want it to. HOwever, i had to comment line 7. because i throws an error.Set getPage = Server.CreateObject("Microsoft.XMLHTTP" )
getPage.Open "GET", "http://www.GSMTEXT.com/", false
'objXMLHTTP.SetRequestHeader "Content-type", "text/html"
getPage.Send
Response.Write("<h1>Page Code</h1>" & chr(13))
Response.Write(server.HTMLEncode(getPage.responseText) & chr(13))
Set getPage = Nothing
I am wondering, if i do a post using this, how do i get the query string status,
REASON:
I am currently posting to my domain name provider using the response.redirect in ASP however when my provider is down. the url crashes showing my username and password.
How do i get the status.
I also tried this script but keep getting access denied
search = request.querystring("search")
dim http
set http=createObject("Microsoft.XMLHTTP")
http.open "GET","http://www.gsmtext.com/api/sendsms.php?Account=1newday&Username=newday&Password=oewetejhn&Mobile=2348023148807&Message=Credited your account&Sender=Olubenin&RedirectUrl=http://www.1newday.com/welcome/welcome/messages/sms.asp"& search,false
http.send
status = http.status
if status=200 then
document.write "<xmp>"
document.write http.getAllResponseHeaders
document.write "</xmp>"
document.write http.responseText
else
document.write "Error: Status: "& status
end if
Just a quick question, is it possible to use xmlhttp to save the dynamically generated SAME PAGE to the server? So that if a page gets loaded with content, can this page be saved as a .txt file using xmlhttp or the FSO?
Bookmarks