Visualizzazione risultati 1 fino 4 di 4

Discussione: problemi con upload tramite VB.net

  1. #1
    sdv
    sdv non è connesso Utente AlterBlog
    Data registrazione
    02-07-2020
    Messaggi
    7

    Predefinito problemi con upload tramite VB.net

    ciao a tutti,
    sto creando un mio blog per far conoscere i miei programmi scritti in VB.
    sto facendo alcuni test e sono incappato in un problema che mi sta facendo diventare matto da un paio di settimane:

    devo fare un download di un file di testo tramite un programma scritto in VB, poi modificarlo e ributtarlo (eseguire l'upload) dello stesso file in FTP su mio spazio web di Altervista.
    riesco senza problemi ad eseguire il download, poi lo modifico, quando poi cerco di eseguire l'upload mi da un errore che credo sia dovuto al Provider di Altervista.
    Riporto il codice:

    Codice:
        Dim WithEvents downloader As New System.Net.WebClient
    
        downloader.DownloadFileAsync(New Uri("https://sdv.altervista.org/wp-content/uploads/Interventi/user.txt"), stNewPercorso & "\user.txt")
    con questo scarico il file, poi lo modifico e poi con questo cerco di fare l'upload:

    Codice:
        Dim uploader As WebClient = New WebClient
    
         uploader.Credentials = New NetworkCredential("user", "password")
         uploader.Proxy = Nothing
         uploader.UploadFile("ftp://ftp.sdv.altervista.org/wp-content/uploads/Interventi/user.txt", stNewPercorso & "\user.txt")
    Niente da fare! l'upload non avviene! mi viene fuori questo messaggio di errore:

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.Net.WebException: The remote server returned an error: (553) File name not allowed.
    at System.Net.WebClient.UploadFile(Uri address, String method, String fileName)
    at System.Net.WebClient.UploadFile(String address, String fileName)
    at Installer.frmFine.agguser() in C:\Users\itsadel\source\repos\Installer\Installer\ frmFine.vb:line 55
    at Installer.frmFine.btnFine_Click(Object sender, EventArgs e) in C:\Users\itsadel\source\repos\Installer\Installer\ frmFine.vb:line 6
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ButtonBase.WndProc(Message& m)
    at System.Windows.Forms.Button.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


    ************** Loaded Assemblies **************
    mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4250.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
    ----------------------------------------
    Installer
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/itsadel/source/repos/Installer/Installer/bin/x64/Debug/Installer.exe
    ----------------------------------------
    Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 14.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
    ----------------------------------------
    System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4200.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4220.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
    ----------------------------------------
    System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4250.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4190.0 built by: NET48REL1LAST_B
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Runtime.Remoting
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
    ----------------------------------------

    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.

    For example:

    <configuration>
    <system.windows.forms jitDebugging="true" />
    </configuration>

    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.
    Qualcuno può aiutarmi?

    grazie

    ciao.

  2. #2
    L'avatar di alemoppo
    alemoppo non è connesso Staff AV
    Data registrazione
    24-08-2008
    Residenza
    PU / BO
    Messaggi
    22,179

    Predefinito

    Assicurati di utilizzare tutti i parametri indicati qui, come ad esempio la modalità passiva.

    Se non dovessi riuscirci, puoi sfruttare un client FTP in modalità linea di comando.

    Ciao!

  3. #3
    sdv
    sdv non è connesso Utente AlterBlog
    Data registrazione
    02-07-2020
    Messaggi
    7

    Predefinito

    Ciao,
    ho usato tutte i parametri indicati dalle direttive Altervista.
    Purtroppo non posso usare un client esterno... ho l'esigenza di eseguire l'upload tramite VB.net. Mi spiego: il mio programma deve eseguire l'upload sul spazio web internet di un file che risiede sul pc dell'utilizzatore, modello statistica di utilizzo.

    la cosa strana è che, tramite VB, riesco senza problemi ad eseguire il download di un file ma non l'upload. Cosa che mi è concessa con qualsiasi client, tipo TotalCommander o FileZilla.

    mi sono spiegato?

    ciao.

  4. #4
    darbula non è connesso AlterGuru 2500
    Data registrazione
    24-04-2011
    Messaggi
    2,894

    Predefinito

    Prova impostando visual studio nel tuo firewall, assicuratevi che le porte da 5000 a 6000 siano libere. Altrimenti prova togliendo la spunta su modalità passiva.

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •