Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/01/2002, 06:57
SimDalom
 
Fecha de Ingreso: noviembre-2001
Ubicación: Pamplona - Marbella (Spain)
Mensajes: 298
Antigüedad: 23 años, 2 meses
Puntos: 0
Re: Urgente Necesito CGI ó JavaScipt!!!

Dos pasos ok?

<pre> &lt;!-- PRIMER PASO: Copiar dentro del tag HEAD --&gt;

&lt;script LANGUAGE=&quot;JavaScript&quot;&gt;

extArray = new Array(&quot;.gif&quot;, &quot;.jpg&quot;);
function LimitAttach(form, file) {
allowSubmit = false;
if (!file) return;
while (file.indexOf(&quot;\\&quot;) != -1)
file = file.slice(file.indexOf(&quot;\\&quot;) + 1);
ext = file.slice(file.indexOf(&quot;.&quot;)).toLowerCas e();
for (var i = 0; i &lt; extArray.length; i++) {
if (extArray == ext) { allowSubmit = true; break; }
}
if (allowSubmit) form.submit();
else
alert(&quot;Se permiten únicamente archivos con la extención: &quot;
+ (extArray.join(&quot; &quot;)) + &quot;\nPor favor, seleccione otro archivo &quot;
+ &quot;e intente de nuevo.&quot;);
}

&lt;/script&gt;
</pre>



<pre> &lt;!-- SEGUNDO PASO: Copiar el formulario dentor del BODY --&gt;

&lt;form method=&quot;post&quot; name=&quot;upform&quot; action=&quot;cgi-bin/tu-script.cgi&quot;
enctype=&quot;multipart/form-data&quot;&gt;
&lt;p&gt;&lt;input type=&quot;file&quot; name=&quot;uploadfile&quot;&gt; &lt;input type=&quot;button&quot; name=&quot;Submit&quot; value=&quot;Enviar&quot;
onclick=&quot;LimitAttach(this.form, this.form.uploadfile.value)&quot;&gt; &lt;/p&gt;
&lt;/form&gt;
</pre>
Ya sta


<center><embed src="http://www.hispaforos.f2s.com/simdalom.swf" width="200" height="100">
</embed></center>