Hi Flex Baby

This is an Example  of Upload file with Flex.. the version of this component
is for Flex 2 but works with Flex 3

*URL of Component :* http://www.cristianhernandez.org/blog/?p=67


*ActionScript **Code for upload:
*

* public function selectHandler(event:Event):void
{
//mx.controls.Alert.show(fileRef.name,’fileRef.name’);
var request:URLRequest = new URLRequest(”
http://localhost/Admision/Default.aspx”);
request.method = URLRequestMethod.POST;
var variables:URLVariables = new URLVariables();
variables.usuario = “LOKI”;
request.data = variables;
try
{
fileRef.upload(request);
textarea1.text = “Enviando ” + fileRef.name + “…”;
}
catch (error:Error)
{
mx.controls.Alert.show(’No se puede Enviar el Archivo’,'Error’);
}
}*

*.Net **Code for upload:*

* protected void Page_Load(object sender, EventArgs e)
{
string uploadFolder = “upload”;
HttpFileCollection files = Request.Files;*

* if (files.Count == 0)
{
Response.Write(”No se encontraron Archivos”);
Response.End();
}
string path = Server.MapPath(uploadFolder);
HttpPostedFile file = files[0];
if (file != null && file.ContentLength > 0)
{
string archivo = Request.Form[”fileName”];
string usuario = Request.Form[”usuario”];
string extension = (archivo.EndsWith(”.jpg”)) ? “.jpg” : “.gif”;
if ((archivo.EndsWith(”.jpg”)) || (archivo.EndsWith(”.gif”)))
{
string savePath = path + “/” + usuario + extension;
file.SaveAs(savePath);
}
}
}*

source: Comment of LOKI in http://www.cristianhernandez.org/blog/?p=43


*Christian*


2009/3/26 Flex Baby <[email protected]>

>
> hi,
> how to upload excel file using flex & asp.net.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to