Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 14 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

PDF:

Feature

WebFileUploader

Uploading user files with a web app

Issue: 10.3 (March/April 2012)
Author: Paul Lefebvre
Article Description: No description available.
Article Length (in bytes): 2,835
Starting Page Number: 73
RBD Number: 10312
Resource File(s):

Download Icon project 10312.zip Updated: Thursday, March 1, 2012 at 11:11 AM

Related Link(s): None
Known Limitations: None

Excerpt of article text...

Real Studio Web Edition has a built in control that makes it easy for your users to upload files to your web application. This month we will take a look at the WebFileUploader control class.

Setup

To get started, create a new Web project and drag a FileUploader onto the default page (changing its name to PictureUploader).

FileUploader has built-in functionality to allow the user to select files to upload. The user clicks the"+" button to add a file to the list. The "-" button can be used to remove files that have been previously added to the list. Try running the project and playing with the buttons so you can see how they work.

Since we only want the user to upload pictures, we can restrict this using the FileAdded event:

If Filename.Right(4) <> ".jpg" And filename.Right(4) <> ".png" Then

MsgBox("Please select pictures.")

Me.RemoveFileAtIndex(Me.FileCount-1)

End If

Run the project again and try to add a non-picture file.

At this point nothing has been uploaded to the server yet. The filenames only exist in the list. To actually upload the files to the server, we need to call the Upload method.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com