Random ASP help!
category: general [glöplog]
Not exactly demo related, but I guess somebody here can help me (and a bunch of other people can post lolcats/carebares/whatever too :)
I'm doing an iphone application for somebody (as contract work), where the app has to send a bit of information and a file to a webserver. No problems my end, but the guy doing the server side has delayed for months, and now seems to have actually disappeared (as in totally gone, not answering any calls, not turning up to work, totally missing!) That leaves us with a bit of a problem :(
So, quick question: The server is using ASP. Is it possible to write a script that just accepts a regular html form + file attachment without needing a session/the client to download the page containing the form? I've done that before easily with PHP, but according to the web programmer missing guy it's not possible with ASP as it relies on 'post back'. Is he right, or can it be done sanely? If it's possible with a straight form upload, any tips on where to find some suitable docs would be good :)
If it's more complicated, another option is for my iphone app to download the form page and return the html request as if it's a regular client, any catches with that approach?
I'm doing an iphone application for somebody (as contract work), where the app has to send a bit of information and a file to a webserver. No problems my end, but the guy doing the server side has delayed for months, and now seems to have actually disappeared (as in totally gone, not answering any calls, not turning up to work, totally missing!) That leaves us with a bit of a problem :(
So, quick question: The server is using ASP. Is it possible to write a script that just accepts a regular html form + file attachment without needing a session/the client to download the page containing the form? I've done that before easily with PHP, but according to the web programmer missing guy it's not possible with ASP as it relies on 'post back'. Is he right, or can it be done sanely? If it's possible with a straight form upload, any tips on where to find some suitable docs would be good :)
If it's more complicated, another option is for my iphone app to download the form page and return the html request as if it's a regular client, any catches with that approach?
Is he cute?
Association of Surfing Professionals?
Harism: cute: no available: no missing: yes
xernobyl: if only :)
xernobyl: if only :)
If it can be done with PHP I don't see any reason for it's impossibility in ASP, not that I've ever seen a line of code in ASP... I think the guy being MIA is a bigger problem.
I can't see it being impossible too, although having some fucked up scheme where form data is only accepted if it came from a form the server just sent out does sound very microsoft ;)
so basically you want to do a raw post request in ASP?
Yeah. Is it possible?
most languages do have HTTP_Request by now?
why not an ASP WebService?
dunno if I get it right what you want, but a WebService would be my first choice to handle an App-to-Server Request
and btw: ASP is not directly the Language you're coding the functions with. ASP is the whole "Technology" with the combination of extended Markup (with special controls & stuff for the frontend/website) and the so called "Code Behind" which can be C#, VB or even PHP! and the code behind is where you code your stuff
dunno if I get it right what you want, but a WebService would be my first choice to handle an App-to-Server Request
and btw: ASP is not directly the Language you're coding the functions with. ASP is the whole "Technology" with the combination of extended Markup (with special controls & stuff for the frontend/website) and the so called "Code Behind" which can be C#, VB or even PHP! and the code behind is where you code your stuff
Thanks, useful replies! Looking into it a bit more, I now see that it's asp.net so I'm guessing from what cab said that it's ASP with the pages written in .net (not that it's really helpful as I've never touched .net either :) Still, .net makes it easier to find somebody to do the work if it's anything complicated.
It doesn't really matter 'how' it works, so long as we can get it working fast - i.e. I'd take 'easy' over 'done right' ;) The uploaded data will be standard and isn't expected to change.. it's just the one form (a video file, title, author etc.)
It doesn't really matter 'how' it works, so long as we can get it working fast - i.e. I'd take 'easy' over 'done right' ;) The uploaded data will be standard and isn't expected to change.. it's just the one form (a video file, title, author etc.)
Well, "ASP" is usually crappy vb-code written by guys in blekinge using accessdatabases.
Asp.net is awesome. I mean, the entire Response and Request classes that is ;)
Asp.net is awesome. I mean, the entire Response and Request classes that is ;)
basically, is this what you're looking for?
?
Code:
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Method = "POST";
req.KeepAlive = true;
UTF8Encoding utf8 = new UTF8Encoding();
byte[] data = utf8.GetBytes(postData);
req.ContentType = "application/x-www-form-urlencoded";
req.ContentLength = data.Length;
Stream stream = req.GetRequestStream();
stream.Write(data, 0, data.Length);
stream.Close();
WebResponse res = req.GetResponse();
?
No problem in posting data to a Asp.Net server.
A handler would be preferable but simpler to just create a page and in your Page_Load handler you have your form data in Request.Form["myniceformvariable"]
Just read up a bit in
http://www.w3schools.com/aspnet/default.asp
http://www.codeproject.com/KB/aspnet/
A handler would be preferable but simpler to just create a page and in your Page_Load handler you have your form data in Request.Form["myniceformvariable"]
Just read up a bit in
http://www.w3schools.com/aspnet/default.asp
http://www.codeproject.com/KB/aspnet/
Gargaj: that looks promising, i now need to go through the docs a bit to see what's happening in that script to know for sure. Thanks :D
Xetick: and those would be the docs I need to go through, again thanks :D
Xetick: and those would be the docs I need to go through, again thanks :D