Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload file Exceptions - Missing IsExist Method #66

Open
emadalslahi opened this issue Dec 30, 2021 · 0 comments
Open

upload file Exceptions - Missing IsExist Method #66

emadalslahi opened this issue Dec 30, 2021 · 0 comments

Comments

@emadalslahi
Copy link

I'm trying to use this lib but When I upload files the respose came with no exception but file didnot uploaded

my code :

Public Async Sub uploadFile()
        Try
            _stpWtch.Restart()
            txt_log.AppendText($" {Environment.NewLine} ============================ uploadFile ======== {_stpWtch.Elapsed} ===============")
            openConn()

            Using _client = New WebDavClient(clientParams)

                Dim _dest_path = $"{_domainName}{_rootPath}{txt_rmot_fil.Text}"

                If chk_pth.Checked Then
                    Try
                        txt_log.AppendText($" {Environment.NewLine}  try to mak dir   [{_stpWtch.Elapsed}] ")
                        Await _client.Mkcol(_dest_path)
                        txt_log.AppendText($" {Environment.NewLine} mkDir {_dest_path}  [{_stpWtch.Elapsed}] ")
                    Catch ex As Exception
                    End Try
                Else
                    txt_log.AppendText($" {Environment.NewLine} ignor chk path  [{_stpWtch.Elapsed}] ")
                End If
                Dim _dest_path_final = $"{_dest_path}/{Path.GetFileName(txt_brws.Text)}"
                Await _client.PutFile(_dest_path_final,
                                      File.OpenRead($"{txt_brws.Text}")) ', "text/plain"

                txt_log.AppendText($" {Environment.NewLine} Compelete uploading file to {_dest_path} [{_stpWtch.Elapsed}]")
                _stpWtch.Stop()
            End Using
        Catch ex As Exception
            _stpWtch.Stop()
            txt_log.AppendText($" {Environment.NewLine} Exception Uploading [ {ex.Message}] at  [{_stpWtch.Elapsed}]")
        End Try
    End Sub

spacially when upload to folder that isnot exist
you can seen that Iam usign mkcol to create folder each time bcz no IsExist Method that chek if file or path is exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant