pouët.net

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?
added on the 2010-03-17 12:31:05 by psonice psonice
Is he cute?
added on the 2010-03-17 12:33:46 by harism harism
Association of Surfing Professionals?

BB Image
added on the 2010-03-17 13:06:54 by xernobyl xernobyl
Harism: cute: no available: no missing: yes

xernobyl: if only :)
added on the 2010-03-17 13:09:06 by psonice psonice
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.
added on the 2010-03-17 14:01:59 by xernobyl xernobyl
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 ;)

BB Image
added on the 2010-03-17 14:19:20 by psonice psonice
so basically you want to do a raw post request in ASP?
added on the 2010-03-17 14:42:17 by Gargaj Gargaj
Yeah. Is it possible?
added on the 2010-03-17 15:15:23 by psonice psonice
most languages do have HTTP_Request by now?
added on the 2010-03-17 15:45:01 by the_Ye-Ti the_Ye-Ti
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
added on the 2010-03-17 16:37:08 by cab cab
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.)
added on the 2010-03-17 16:51:47 by psonice psonice
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 ;)
added on the 2010-03-17 20:14:16 by Hatikvah Hatikvah
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();


?
added on the 2010-03-17 21:22:15 by Gargaj Gargaj
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/
added on the 2010-03-17 22:44:56 by Xetick Xetick
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
added on the 2010-03-18 11:27:37 by psonice psonice

login