Upload file to mapped network drive from symfony application

25 Views Asked by At

I have a symfony application from which I want users to be able to upload files to their network drive

I mapped my onedrive to my network drive a network drive I could use for testing. Then I try using fileSystem to upload file to it from my application, but it don’t seem to be working.. I get a 404 error whenever I try to upload the file.


     $client = new Client([
                'baseUri' => "https://d.docs.live.net/6A3F6B58197AC1EC",
                'userName' => $username,
                'password' => $password,
//                'proxy' => 'localhost:8888',
            ]);

            $adapter = new WebDAVAdapter($client);
            $filesystem = new Filesystem($adapter);
//            $path= urlencode($host);
//            dd($path);
            try {
                $filesystem->write("https://d.docs.live.net/6A3F6B58197AC1EC/"."file.txt", "I am  boy");
//                echo $response;
            } catch (FilesystemException | UnableToReadFile $exception) {
                // handle the error
                dd($exception);
            }

0

There are 0 best solutions below