mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-02 11:44:45 -06:00
Convert spaces in the path only for now
This commit is contained in:
@@ -6,7 +6,6 @@ package duplicacy
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
"net/url"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type B2Storage struct {
|
type B2Storage struct {
|
||||||
@@ -211,7 +210,7 @@ func (storage *B2Storage) GetFileInfo(threadIndex int, filePath string) (exist b
|
|||||||
// DownloadFile reads the file at 'filePath' into the chunk.
|
// DownloadFile reads the file at 'filePath' into the chunk.
|
||||||
func (storage *B2Storage) DownloadFile(threadIndex int, filePath string, chunk *Chunk) (err error) {
|
func (storage *B2Storage) DownloadFile(threadIndex int, filePath string, chunk *Chunk) (err error) {
|
||||||
|
|
||||||
filePath = url.PathEscape(filePath)
|
filePath = strings.Replace(filePath, " ", "%20", -1)
|
||||||
readCloser, _, err := storage.clients[threadIndex].DownloadFile(filePath)
|
readCloser, _, err := storage.clients[threadIndex].DownloadFile(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -225,7 +224,7 @@ func (storage *B2Storage) DownloadFile(threadIndex int, filePath string, chunk *
|
|||||||
|
|
||||||
// UploadFile writes 'content' to the file at 'filePath'.
|
// UploadFile writes 'content' to the file at 'filePath'.
|
||||||
func (storage *B2Storage) UploadFile(threadIndex int, filePath string, content []byte) (err error) {
|
func (storage *B2Storage) UploadFile(threadIndex int, filePath string, content []byte) (err error) {
|
||||||
filePath = url.PathEscape(filePath)
|
filePath = strings.Replace(filePath, " ", "%20", -1)
|
||||||
return storage.clients[threadIndex].UploadFile(filePath, content, storage.UploadRateLimit/len(storage.clients))
|
return storage.clients[threadIndex].UploadFile(filePath, content, storage.UploadRateLimit/len(storage.clients))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user