Hi All,
I posted something similar but I am changing my question around enough to warrant a new post.
I am trying to handle a posted file to an aspx page (C#). I am told this is not possible without a postback from <input type=file>
or the asp file uploader. However, I have a PHP script does this perfectly, so I am really hoping it can be accomplished in C#/ASP.NET.
I am trying to post an image form a mobile device, so an actual <input type=file>
is not an option.
Any thoughts and advise would really help!
PHP:
<?php
$uploaddir = 'uploads/';
$file = basename($_FILES['userfile']['name']);
$uploadfile = $uploaddir . $file;
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "http://urlgoeshere.om/uploads/{$file}";
}
else {
echo "No files uploaded\n";
}
?>
How can this be done in ASP.NET?