JavaScript - Crear HREF automaticos

 
Vista:

Crear HREF automaticos

Publicado por Albert Cañelles Panisello (1 intervención) el 18/12/2013 09:51:35
Hola buenos dias/tardes/noches tengo un problema estoy trabajando con JavaScript y tengo un problema.

Estoy creando un modulo para subir imagenes el tipico boton examinar y subir esto lo tengo ya todo pero ahora me falta que cuando haces click al boton de subir cree automaticamente el href a la imagen que esta pasada con una varible les dejo mi codigo y si pueden me ayudan gracias

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<html>
 
<head>
<META name="WebPartPageExpansion" content="full">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <script type="text/javascript">
        function GetInputValue () {
            var destino = "C:\\Users\\usuario\\Desktop\\";
            var destimesimatge = "";
            var origen = document.getElementById ("fileToUpload");
            fso = new ActiveXObject("Scripting.FileSystemObject");
 
			var mySplitResult = origen.value.split("\\");
			for(i = 0; i < mySplitResult.length; i++){
     			if (mySplitResult.length==i+1) {
 
    				destimesimatge = "C:\\Users\\usuario\\Desktop\\"+ mySplitResult[i];
    				alert(destimesimatge);				}
 
			}
 
 
 
			  fso.CopyFile (origen.value,destino,0);
 
 
 
 
                   }
  </script>
 
<title>Pujar Fotos</title>
</head>
 
<body>
 
<DIV>
 
 <input type="file" id="fileToUpload" size="50"/>
 <button onclick="GetInputValue()">Guardar</button>
</body>
 
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder