Descargar archivo en Flash 8

  • James R
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Ene 17, 2007
  • Mensajes: 6
  • Loc: Dublin
  • Status: Offline

Nota Enero 23rd, 2007, 1:27 pm

Im conseguir esto:

"Cabecera (Content-disposición: attachment; filename = desencadenar - januarys_blue [jan_07]. Mp3); cabecera (Content-Type: audio/mp3); archivo de descarga"

:-S
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Enero 23rd, 2007, 1:27 pm

  • IceCold
  • Guru
  • Guru
  • Avatar de Usuario
  • Registrado: Nov 05, 2004
  • Mensajes: 1254
  • Loc: Ro
  • Status: Offline

Nota Enero 23rd, 2007, 11:23 pm

did u usar la etiqueta de la cabeza?
Código: [ Select ]
<html>
 <head>
   header('Content-disposition: attachment; filename=filename.jpg');
   header('Content-type: audio/mp3');
 </head>
<body>
  <a href="trigger--januarys_blue[jan_07].mp3">download file</a>
</body>
</html>
  1. <html>
  2.  <head>
  3.    header('Content-disposition: attachment; filename=filename.jpg');
  4.    header('Content-type: audio/mp3');
  5.  </head>
  6. <body>
  7.   <a href="trigger--januarys_blue[jan_07].mp3">download file</a>
  8. </body>
  9. </html>

para este u sólo debe tener: Descarga de archivos
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
  • Xarathal
  • Born
  • Born
  • Avatar de Usuario
  • Registrado: Abr 20, 2007
  • Mensajes: 3
  • Status: Offline

Nota Abril 20th, 2007, 5:24 pm

Por cierto, usted también puede usar el "Flash FileReference.download" método para descargar archivos, y usted no necesita ningún PHP. Su bastante resbaladiza:

descarga pública (url: String, [DefaultFileName: String]): Boolean

Código: [ Select ]
import flash.net.FileReference;

var listener:Object = new Object();

listener.onSelect = function(file:FileReference):Void {
  trace("onSelect: " + file.name);
}

listener.onCancel = function(file:FileReference):Void {
  trace("onCancel");
}

listener.onOpen = function(file:FileReference):Void {
  trace("onOpen: " + file.name);
}

listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
  trace("onProgress with bytesLoaded: " + bytesLoaded + " bytesTotal: " + bytesTotal);
}

listener.onComplete = function(file:FileReference):Void {
  trace("onComplete: " + file.name);
}

listener.onIOError = function(file:FileReference):Void {
  trace("onIOError: " + file.name);
}

var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
var url:String = "http://www.macromedia.com/platform/whitepapers/platform_overview.pdf";
if(!fileRef.download(url, "FlashPlatform.pdf")) {
  trace("dialog box failed to open.");
}
  1. import flash.net.FileReference;
  2. var listener:Object = new Object();
  3. listener.onSelect = function(file:FileReference):Void {
  4.   trace("onSelect: " + file.name);
  5. }
  6. listener.onCancel = function(file:FileReference):Void {
  7.   trace("onCancel");
  8. }
  9. listener.onOpen = function(file:FileReference):Void {
  10.   trace("onOpen: " + file.name);
  11. }
  12. listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
  13.   trace("onProgress with bytesLoaded: " + bytesLoaded + " bytesTotal: " + bytesTotal);
  14. }
  15. listener.onComplete = function(file:FileReference):Void {
  16.   trace("onComplete: " + file.name);
  17. }
  18. listener.onIOError = function(file:FileReference):Void {
  19.   trace("onIOError: " + file.name);
  20. }
  21. var fileRef:FileReference = new FileReference();
  22. fileRef.addListener(listener);
  23. var url:String = "http://www.macromedia.com/platform/whitepapers/platform_overview.pdf";
  24. if(!fileRef.download(url, "FlashPlatform.pdf")) {
  25.   trace("dialog box failed to open.");
  26. }

Para obtener más información sobre el método de descarga, busque la clase FileReference y mirar el método de descarga.

Una cosa a tener en cuenta: la dirección URL debe ser una petición HTTP o HTTPS.

Rock On,

- Eric
http://www.thecosmonaut.com
  • musik
  • Legend
  • Super Moderator
  • Avatar de Usuario
  • Registrado: Ago 06, 2003
  • Mensajes: 6892
  • Loc: up a tree
  • Status: Offline

Nota Septiembre 10th, 2007, 10:53 pm

IceCold escribió:
crear una página HTML con el código dentro de ella, lugar en el servidor y ver si se descarga cuando la prensa u el enlace:
Código: [ Select ]
<html>
header('Content-disposition: attachment; filename=filename.jpg');
header('Content-type: audio/mp3');
<body>
  <a href="trigger--januarys_blue[jan_07].mp3">download file</a>
</body>
</html>
  1. <html>
  2. header('Content-disposition: attachment; filename=filename.jpg');
  3. header('Content-type: audio/mp3');
  4. <body>
  5.   <a href="trigger--januarys_blue[jan_07].mp3">download file</a>
  6. </body>
  7. </html>

Pero, si quieres enlaces dinámicos...se necesita un script del lado del servidor.


¿Qué sucede con el código de cabecera si usted tiene más de un archivo que desea permitir a los usuarios descargar, por ejemplo 40 o así?

¡Salud!.
Opportunity To Do - Changing the lives of children around the world.
Rose.id.au - Doing Life.

Publicar Información

  • Total de mensajes en este tema: 19 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 32 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC