Git Product home page Git Product logo

webdavclient's Introduction

webdavclient's People

Contributors

decatec avatar dominikholler avatar geoffroyquerol avatar jonasprogrammer avatar mkuennekesdx avatar mumusbtc avatar saguiitay avatar yuchting avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webdavclient's Issues

Windows Authentication?

How can I get WebDAVClient.Client to re-useuse the current Windows credentials without having to pass a NetworkCredential with a username/password? The reason I ask is that we want to use this library in a ASP.NET application which already is configured to run in an IIS app pool with the correct Windows credentials (a service account).

Exceptions not informative

I am trying to upload files to WebDAV on IIS 10...however I seem to get an error message when uploading a file (DELETE; READ; ETC...works).

Is there any way to get more information out of the exception then just "File can not be uploaded" and the error id (which is 0)?

Could not load type 'WebDAVClient.Client'

{"Message":"An error has occurred.","ExceptionMessage":"Could not load type 'WebDAVClient.Client' from assembly 'WebDavClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.","ExceptionType":"System.TypeLoadException","StackTrace":" at WebDavClient.Controllers.WebDavController.d__3.MoveNext()\r\n at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)\r\n at WebDavClient.Controllers.WebDavController.Post()\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_1.b__1(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__15.MoveNext()"}

Wrong usage of nullable Port in Client.cs leads to exeption

Hello,
Thanks for providing us this useful code.
I think there is an issue in the way you use the "Port" property in Client.
Port is declared as int? Port { get; set;} with the comment "Specify an port (default: null = auto-detect)"
However when you use it in GetServerUrl you just cast it to int, which throws an InvalidOperationException of Port is null (there are several occurences).
I think this usage of Port defeat the "null = auto-detect" as it force user to set a value for Port (as far as I can say your basic example and test doesn't work for this reason).
I don't know what was your intent exactly, but maybe you sould replace all occurences of "(int)Port" with "Port ?? -1" for instance.

Fault @ c.List() - Please assist

I have the following code with the correct UN and PW, yet the code continues to error out (NOTE: There is no trouble connecting via WebDAV using SCP or other clients):
IClient c = new Client(new NetworkCredential { UserName = USERNAME, Password = PASSWORD });
c.Server = "https://app.latista.com";
c.BasePath="/webdav/messer/project_133/Test""
var files = await c.List(); //await c.List();

error CS4033: The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'.
c.List()
Id = 12, Status = Faulted, Method = "{null}", Result = "{Not yet computed}"
AsyncState: null
CancellationPending: false
CreationOptions: None
Exception: Count = 1
Id: 12
Result: null
Status: Faulted

Any thoughts?
Thanks - Mike

NuGet

Is it possible to make update to nuget package according to actual sources, please?

Not working with owncloud

Hi,

I've tried your Implementation with owncloud and it's not working.

var client = new WebDAVClient.Client(new NetworkCredential { UserName = "myUserName",  Password = "MyPw" });
var baseUrl = "https://myUrl/remote.php/webdav/";

client.Server = baseUrl;
client.BasePath = "/";
var files = await client.List();

Then I've tried this GitHub Repo

https://github.com/DecaTec/Portable-WebDAV-Library

with the same URLs I've tried with your Implementation and there it works fine.

CreationDate can be null

I have connected to an owncloud (OWdrive) server. This seems to return null for the CreationDate property so causes an exception when attempting to use this value in Client.cs List and Get functions.

License for this project?

I see you've got the project available as a NuGet package, but what's the license to use it? MIT? Apache? BSD? GPL?

Thanks!
Matt

Synchronizing All files from Server

HI, I tried to synchronize all the files from the server using a loop for downloading all the files and directories but I'm getting:

Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in mscorlib.dll

the thread is getting getting exit.

I got a list from server then I tried to download the whole list one by one. but it's not working because of this exception. Is there any solution to do it? I want to keep it synchronizing after a fixed interval of time.

And I want to download files with 250 MB maximum size. How can I enable with this project?

Thanks for any kind of Help!

WebDAV sending LastModified time equal to NULL in Arabic and Hebrew language only

Hi

In the Client.cs class, there is a list function from which we get all the files in our WebDAV directory.

response = await HttpRequest(listUri, PropFind, headers, Encoding.UTF8.GetBytes(PropFindRequestContent)).ConfigureAwait(false);

            if (response.StatusCode != HttpStatusCode.OK &&
                (int) response.StatusCode != HttpStatusCode_MultiStatus)
            {
                throw new Exception("Failed retrieving items in folder.");
            }

            using (var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false))
            {
                var result = ResponseParser.ParseItems(path, stream);

When I am listing folders or files in Arabic or Hebrew language, the LastModified time is coming NULL of an item in result. And when I was trying the same with other languages except Arabic and Hebrew, the LastModified time is coming fine.

Please help me to workaround this issue!

Thanks & Regards,
Abhishek Jindal

Question regarding use of TLS (Transport Layer Security)

Hello,

I am using v1.1.3 of the WebDAVClient. Our storage provider has advised us that it will discontinue support for TLS 1.0 in the near future.
I am trying to find out if the WebDAVClient uses TLS, and if so, what version.

Thanks for your help
Mike

SSL Certificate

I was having trouble with my SSL certificate for my owner https server as it was self signed (no root authority), adding this to the test program helped me figure out the problem. Just wondered if might me useful to add.

using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System;

namespace TestWebDAVClient
{
class Program
{
...

    private static bool ValidateCertificate(
        object sender,
        X509Certificate certificate,
        X509Chain chain,
        SslPolicyErrors sslPolicyErrors)
    {
        Console.WriteLine("Issued by: " + certificate.Issuer);
        Console.WriteLine("Issued to: " + certificate.Subject);
        Console.WriteLine("Valid until: " + certificate.GetExpirationDateString());

        if (sslPolicyErrors == SslPolicyErrors.None)
            Console.WriteLine("Valid server certificate");

        return true;
    }
    private static async Task MainAsync()
    {
        ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ValidateCertificate);

        // Basic authentication required
...

Item List from ownCloud does not get Collection=true for folders

Hi,
This is the response from the PROPFIND call to ownCloud:

 <d:response>
  <d:href>/remote.php/webdav/xxxxxxxxxxxxxxxxxxx/</d:href>
  <d:propstat>
   <d:prop>
    <d:getlastmodified>Fri, 16 Sep 2016 08:00:22 GMT</d:getlastmodified>
    <d:resourcetype>
     <d:collection/>
    </d:resourcetype>
    <d:quota-used-bytes>24569936</d:quota-used-bytes>
    <d:quota-available-bytes>-3</d:quota-available-bytes>
    <d:getetag>&quot;57dba696c1d62&quot;</d:getetag>
   </d:prop>
   <d:status>HTTP/1.1 200 OK</d:status>
  </d:propstat>
 </d:response>

Even if the "resourcetype" is flagged as "collection", the resulting Item has IsCollection set to false.

Move

Add support for Move

What about disposing?

Hi!
Client class is not implementing IDisposable interface, so as HttpClientWrapper.
And my question is: how it disposes HttpClient instances?
Potentially, it causes a memory leak, I guess...

Using WebDAVClient.Client BasePath

Not sure what is meant to happen here, but if I set the BasePath to "/remote.php/webdav". Then using folder.Href gives a path that includes the base path. So if this is then used in Get/List etc the base path is again added to the path being used so becomes "/remote.php/webdav/remote.php/webdav"

no full documented examples

I need to use this library from nuget with VB.net

but I cant write any code base on your examples

I wish you provided full real app example with exceptions and so on..

so that we can understand how to deal with this lib. and use it with deferent features
eg:
how to upload file
how to handel errors and store config vars.
you can see other libs has full document for all featuers with details examples..

is WebDavClient supported into ASP.NET Core 2 App?

I am try use WebDavClient into ASP.NET Core 2 App, but i get this error calling List Method

Could not load type 'System.Web.HttpException' from assembly 'System.Web, Version=4.0.0.0'

is already compatible con ASP.NET Core 2?

Problem moving files

Hi, some files with specific characters (+~$&ยฐ) have problem only on move, upload and delete works fine. Could it be related to how the destination path is specified?

headers.Add("Destination", dstUri.ToString());

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.