(ctx context.Context, path string, trunc bool)
| 51 | } |
| 52 | |
| 53 | func 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 | |
| 70 | func (f *FileUploadProxy) Read(p []byte) (n int, err error) { |
| 71 | return 0, errs.NotSupport |
no test coverage detected