// UploadFile takes a file path and upload it to ipfs
// and return the generate hash.
UploadFile takes a file path and upload it to ipfs
and return the generate hash.
// UploadFile takes a file path and upload it to ipfs // and return the generate hash .
func UploadFile(p string) (string, error) {
	isLive, err := IsLive()
	if err != nil {
		return "", err
	}
	if !isLive {
		return "", ErrNodeOffline
	}
	file, err := os.Open(p)
	if err != nil {
		return "", err
	}
	defer file.Close()
	sys.Notify("Uploading: ", file.Name())
	cid, err := Shell.Add(file)
	if err != nil {
		return "", err
	}
	sys.Notify("Uploaded: ", cid)
	return cid, nil
}
func UploadFile ( p string ) ( string , error ) { isLive , err := IsLive ( ) if err != nil { return " " , err } if ! isLive { return " " , ErrNodeOffline } file , err := os . Open ( p ) if err != nil { return " " , err } defer file . Close ( ) sys . Notify ( " " , file . Name ( ) ) cid , err := Shell . Add ( file ) if err != nil { return " " , err } sys . Notify ( " " , cid ) return cid , nil }
UploadFile takes a file path and upload it to ipfs
and return the generate hash.
UploadFile takes a file path and upload it to ipfs and return the generate hash .