UrlHelper.FileUrl Method

Namespace:
Weavy.Core.Helpers
Assembly:
Weavy.Core.dll

Overloads

FileUrl(Attachment, string, bool, bool) Returns the url to the binary data of an attachment.
FileUrl(Blob, string, bool, bool) Returns the url to the binary data of a blob.
FileUrl(IFile, string, bool, bool) Returns the url to the binary data of a file.

FileUrl(Attachment, string, bool, bool)

Returns the url to the binary data of an attachment.

public static string FileUrl(this Attachment attachment, string extension = null, bool absolute = false, bool download = false)

Parameters

attachment
Attachment

The attachment to get url for.

extension
string

File extension of desired output format, null to keep original format.

absolute
bool

false to return a relative url or true to return an absolute url.

download
bool

false to return an url for displaying the content inline or true to return an url for downloading the content.

Returns

string

FileUrl(Blob, string, bool, bool)

Returns the url to the binary data of a blob.

public static string FileUrl(this Blob blob, string extension = null, bool absolute = false, bool download = false)

Parameters

blob
Blob

The blob to get url for.

extension
string

File extension of desired output format, null to keep original format.

absolute
bool

false to return a relative url or true to return an absolute url.

download
bool

false to return an url for displaying the content inline or true to return an url for downloading the content.

Returns

string

FileUrl(IFile, string, bool, bool)

Returns the url to the binary data of a file.

public static string FileUrl(this IFile file, string extension = null, bool absolute = false, bool download = false)

Parameters

file
IFile

The entity to get url for.

extension
string

File extension of desired output format, null to keep original format.

absolute
bool

false to return a relative url or true to return an absolute url.

download
bool

false to return an url for displaying the content inline or true to return an url for downloading the content.

Returns

string