WebFile.Data

From Xojo Documentation

Revision as of 16:07, 11 August 2017 by PLefebvre (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Property (As MemoryBlock )
aWebFile.Data = newMemoryBlockValue
or
MemoryBlockValue = aWebFile.Data

New in 2010r5

Supported for all project types and targets.

Contains the data in the file. Data is initially a 0-byte MemoryBlock. The developer should create a new MemoryBlock of the size that will be needed to store the data.

Notes

You can also just assign a String as the Data.

Example

Create a new file for downloading:

TextFile = New WebFile // TextFile is a property of the web page
TextFile.MimeType = "text/plain"
TextFile.ForceDownload = True // If False, the browser may try to display the file instead of download it
TextFile.FileName = "TextFile.txt"

TextFile.Data = "Hello, world!"

ShowURL(TextFile.URL) // This causes the file to be downloaded