Quantcast
Channel: Adobe Community : Popular Discussions - FlexUnit
Viewing all articles
Browse latest Browse all 25673

Uploading File classic ASP

$
0
0

Hi

Im a new flex developer and i making an app that insert data into a db and upload a file in a path web server, but my problem is when i send to asp my archive there is no way to save on the path and there is no error message, the asp works when i use html for send it a file it works perfectly but when i send it a file with flex not , so i need your help

 

code as3 when user clicks on a textinput

 

  archivo0.browse([filtro]);

                                                  archivo0.addEventListener(Event.SELECT, onFileSelected);

                                                  archivo0.addEventListener(IOErrorEvent.IO_ERROR, errorUp);

                                                  archivo0.addEventListener(SecurityErrorEvent.SECURITY_ERROR,erro rUp);

                                                  archivo0.addEventListener(Event.COMPLETE,completado);

 

  protected function onFileSelected(e:Event):void {

                                        e.target.addEventListener(Event.COMPLETE, onFileLoaded);

                                        e.target.load();

                              }

 

                              protected function onFileLoaded(e:Event):void{

 

                                        var nombrearchivo:URLVariables = new URLVariables();

                                        nombrearchivo.nombre = e.target.name;

                                        peticion.data = nombrearchivo;

                                        e.target.upload(peticion);

                                        trace(">>>>442",e.target)

                              }

                              protected function errorUp(e:Event):void {

                                        Alert.show(e.toString());

                              }

                              protected function completado(e:Event):void {

                                        Alert.show("Archivo uploadeado");

                              }

 

AND THE CODE OF ASP IS

 

<%

   Response.Buffer = True

 

 

   ' load object

   Dim load

      Set load = new Loader

 

 

      ' calling initialize method

      load.initialize

 

 

   ' File binary data

   Dim fileData

      fileData0 = load.getFileData("nombre")

                       

   ' File name

   Dim fileName

      fileName0 = LCase(load.getFileName("nombre"))

 

Dim pathToFile

      pathToFile0 = Server.mapPath("uploaded/") & "\" & fileName0

             ' Uploading file data

   Dim fileUploaded

      fileUploaded0 = load.saveToFile ("nombre", pathToFile0)

 

   ' destroying load object

   Set load = Nothing

%>


Viewing all articles
Browse latest Browse all 25673

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>