MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / OpenUpload

Function OpenUpload

server/ftp/fsup.go:53–68  ·  view source on GitHub ↗
(ctx context.Context, path string, trunc bool)

Source from the content-addressed store, hash-verified

51}
52
53func OpenUpload(ctx context.Context, path string, trunc bool) (*FileUploadProxy, error) {
54 err := uploadAuth(ctx, path)
55 if err != nil {
56 return nil, err
57 }
58 // Check if system file should be ignored
59 _, name := stdpath.Split(path)
60 if setting.GetBool(conf.IgnoreSystemFiles) && utils.IsSystemFile(name) {
61 return nil, errs.IgnoredSystemFile
62 }
63 tmpFile, err := os.CreateTemp(conf.Conf.TempDir, "file-*")
64 if err != nil {
65 return nil, err
66 }
67 return &FileUploadProxy{buffer: tmpFile, path: path, ctx: ctx, trunc: trunc}, nil
68}
69
70func (f *FileUploadProxy) Read(p []byte) (n int, err error) {
71 return 0, errs.NotSupport

Callers 1

GetHandleMethod · 0.85

Calls 3

GetBoolFunction · 0.92
IsSystemFileFunction · 0.92
uploadAuthFunction · 0.85

Tested by

no test coverage detected