Skip to content

Commit

Permalink
Merge pull request #1696 from 0chain/feat/suggested-name
Browse files Browse the repository at this point in the history
Add option for suggested name
  • Loading branch information
dabasov authored Dec 3, 2024
2 parents 372ddd3 + 9d151bd commit bc8a669
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion wasmsdk/blobber.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,9 @@ func multiDownload(allocationID, jsonMultiDownloadOptions, authTicket, callbackF
}
var mf sys.File
if option.DownloadToDisk {
terminateWorkersWithAllocation(alloc)
if option.SuggestedName != "" {
fileName = option.SuggestedName
}
mf, err = jsbridge.NewFileWriter(fileName)
if err != nil {
PrintError(err.Error())
Expand Down Expand Up @@ -589,6 +591,7 @@ type MultiDownloadOption struct {
RemoteFileName string `json:"remoteFileName"` //Required only for file download with auth ticket
RemoteLookupHash string `json:"remoteLookupHash,omitempty"` //Required only for file download with auth ticket
DownloadToDisk bool `json:"downloadToDisk"`
SuggestedName string `json:"suggestedName,omitempty"` //Suggested name for the file when downloading to disk, if empty will use base of remote path
}

// MultiOperation do copy, move, delete and createdir operation together
Expand Down

0 comments on commit bc8a669

Please sign in to comment.