From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Property (As MemoryBlock )
aWebFile.Data = newMemoryBlockValue
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.


You can also just assign a String as the Data.


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