Newsgroup: it.comp.lang.javascript
Titolo: Problema con upload di un file

Ho necessita' di fare un upload di un file attraverso una pagina web.
Per fare cio' uso delle dll che ho scaricato, ma ricevo dei problemi:
Errore di run-time di Microsoft JScript error '800a01c2'
Numero errato di argomenti o assegnazione di proprietą non valida
Di seguito riporto il codice del programma in vbscript e quello in
javascript (tradotto da me)
--------------------------
<%
   Dim mySmartUpload
   Dim file
   Dim intCount
   intCount=0
   Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
   mySmartUpload.AllowedFilesList = "jpg"
   mySmartUpload.Upload
   For each file In mySmartUpload.Files
      If not file.IsMissing Then
 file.SaveAs("c:\www_prove\furniture\images\banners\banner1.jpg")
         Response.Write("Name = " & file.Name & "<BR>")
         Response.Write("Size = " & file.Size & "<BR>")
         Response.Write("FileName = " & file.FileName & "<BR>")
         Response.Write("FileExt = " & file.FileExt & "<BR>")
         Response.Write("FilePathName = " & file.FilePathName & "<BR>")
         Response.Write("ContentType = " & file.ContentType & "<BR>")
         Response.Write("ContentDisp = " & file.ContentDisp & "<BR>")
         Response.Write("TypeMIME = " & file.TypeMIME & "<BR>")
         Response.Write("SubTypeMIME = " & file.SubTypeMIME & "<BR>")
         intCount = intCount + 1
      End If
   Next
   Response.Write("<BR>" & mySmartUpload.Files.Count & " files could be
uploaded.<BR>")
   Response.Write(intCount & " file(s) uploaded.<BR>")
%>
--------------------------
<%
   var file;
   var intCount;
   intCount=0;
   var mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload");
   mySmartUpload.AllowedFilesList = "jpg";
   mySmartUpload.Upload;
   for (file in mySmartUpload.Files){
      if (!file.IsMissing){
 file.SaveAs("c:\www_prove\furniture\images\banners\banner1.jpg");
         Response.Write("Name = " & file.Name & "<BR>");
         Response.Write("Size = " & file.Size & "<BR>");
         Response.Write("FileName = " & file.FileName & "<BR>");
         Response.Write("FileExt = " & file.FileExt & "<BR>");
         Response.Write("FilePathName = " & file.FilePathName & "<BR>");
         Response.Write("ContentType = " & file.ContentType & "<BR>");
         Response.Write("ContentDisp = " & file.ContentDisp & "<BR>");
         Response.Write("TypeMIME = " & file.TypeMIME & "<BR>");
         Response.Write("SubTypeMIME = " & file.SubTypeMIME & "<BR>");
         intCount = intCount + 1;
      }
   }
   Response.Write("<BR>" & mySmartUpload.Files.Count & " files could be
uploaded.<BR>");
   Response.Write(intCount & " file(s) uploaded.<BR>");
%>
--------------------------
La linea che da errore e' la seguente:
mySmartUpload.Upload
Cosa puo' essere?
Vi ringrazio in anticipo
Alessandro
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com
 - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

 Alessandro
Forse questo e' l'errore:
The Upload method must be called before any other methods of the
aspSmartUpload object.
Non userei il termine file per evitare conflitti.
Cosi' funziona, escluso i "file permessi" che non mi hanno fatto da
filtro:
----------
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
mySmartUpload.Upload
mySmartUpload.AllowedFilesList = "jpg"  ' questo non ha bloccato un
file?
Response.Write(mySmartUpload.Files.count & "<br>")
For each pippo In mySmartUpload.Files
 If not pippo.IsMissing Then
  pippo.SaveAs("/pippo/dati/" & pippo.filename)
  Response.Write("Name = " & pippo.Name & "<BR>")
............
Saluti, Paolo