file

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteFile

func DeleteFile(filename, uploadDirectory string) error

DeleteFile removes a single file from the specified directory.

func DeleteMultipleFiles added in v1.0.3

func DeleteMultipleFiles(filenames []string, uploadDirectory string) error

DeleteMultipleFiles removes multiple files from the specified directory. filenames: A slice of filenames to be deleted. uploadDirectory: The directory where files are stored. Returns an error if any file fails to delete, but continues attempting deletion for others.

func UploadFile

func UploadFile(file io.Reader, headerFilename, uploadDirectory string) (string, error)

UploadFile handles the uploading of a single file.

func UploadMultipleFiles added in v1.0.3

func UploadMultipleFiles(files []io.Reader, headerFilenames []string, uploadDirectory string) ([]string, error)

UploadMultipleFiles handles the uploading of multiple files. files: A slice of file readers and their original filenames. uploadDirectory: The directory where files should be uploaded. Returns a slice of unique filenames or an error if the upload fails for any file.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL