kalvillo
asked on
Transition from PHP to ASP.net
Hi.
I'm starting to code in ASP.NET, and i have the following question.
I want to code a program to upload a file using "actionscript 2.0" ( flash.net.FileReference) on VB.NET; right now, i know how to do this using Perl and PHP ( "move_uploaded_file($_FILES ['Filedata ']['tmp_na me'], "./imgage_files/".$_FILES[ 'Filedata' ]['name']) "),
but i can't find how to accomplish the same task using this language.
I hope you could help me, and thank you very much.
I'm starting to code in ASP.NET, and i have the following question.
I want to code a program to upload a file using "actionscript 2.0" ( flash.net.FileReference) on VB.NET; right now, i know how to do this using Perl and PHP ( "move_uploaded_file($_FILES
but i can't find how to accomplish the same task using this language.
I hope you could help me, and thank you very much.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
niralshah> that's not exactly what i'm looking for...
Right now, i have the following Flash code to "browse" my files:
When you select the desired file in the dialog box, Flash sends the file to the following code in PHP:
This PHP code delivers the file into the server.
What i need is a code in ASP.NET that do the same thing than the PHP one... i mean, the Flash code works fine as it is, i just need a code in ASP to conect with such flash code.
Right now, i have the following Flash code to "browse" my files:
import flash.net.FileReference;
_root.http_file = "http://myDom.com/upload.php";
// start exploration
btnListener.click = function(eventObj:Object) {
var fileRef:FileReference = new FileReference();
fileRef.addListener(fileListener);
fileRef.browse(fileTypes);
}
//send file selected
fileListener.onSelect = function(file:FileReference):Void {
resultsTxtField.text += "File Selected: " + file.name;
if(!file.upload(_root.http_file)) {
resultsTxtField.text += "Upload dialog failed to open.\n";
}
}
When you select the desired file in the dialog box, Flash sends the file to the following code in PHP:
<?php
move_uploaded_file($_FILES['Filedata']['tmp_name'], "./file_images/".$_FILES['Filedata']['name']);
chmod("./file_images/".$_FILES['Filedata']['name'], 0777);
?>
This PHP code delivers the file into the server.
What i need is a code in ASP.NET that do the same thing than the PHP one... i mean, the Flash code works fine as it is, i just need a code in ASP to conect with such flash code.
ASKER
niralshah> by the way.. that code that you send me, do you have it on "Action Script 2"?... it could be handy for another process.
But you can try search in goole by uing such phrase:
"ASP.net equivalient to move_uploaded_file()"
most of the time would not disappoint you.