Tuesday 15 June 2010

Reproduce Php curl script in ASP.net -



Reproduce Php curl script in ASP.net -

i php developer, have few lines of php picks image upload form, sends off java servlet, wait response servlet , executes if...else if....else statement depending on servlet returns. need take dive asp.net need duplicate same client portal running on asp.net.

majorly, need y'all help explain me step step how to:

fetch image form using asp.net

save in asp.net variable.

how create arrays in asp.net

asp.net equivalent of php curl.

how utilize switch and/or if...else statement in asp.net

<?php $filename = $_files['file']['name']; $filedata = $_files['file']['tmp_name']; $bla = "xxxdddggg"; $blabla = 11; $postfields = array("bla"=> $bla, "blabla"=> $blabla, "filedata" => "@$filedata", "filename" => $filename); $url = "http://somewherecontainingmyjavaservlet"; $headers = array("content-type:multipart/form-data"); $ch = curl_init($filename); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_header, $headers); curl_setopt($ch, curlopt_post, 1); curl_setopt($ch, curlopt_postfields, $postfields); curl_setopt($ch, curlopt_returntransfer, true); $guy = curl_exec($ch); curl_close($ch); $arr1 = str_split($guy); $returnvaal = $arr1[count($arr1)-1]; echo $returnvaal; ?>

thanks

php asp.net asp.net-mvc curl

No comments:

Post a Comment