CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Simple Example of File Upload

Print topic Send  topic

Author Message
swilson


Posts: 84
Posted: 10/04/2005, 1:22 PM

Is there a simple example of a single file upload, specifically a .jpg file, that upon upload writes the filename to a record that when listed in a grid displays the photo?

Is there an example of how to create a photo gallery, where the user can upload the photos, and they are sized appropriately when listed in a grid, no matter the upload size?

I'm looking for better and simpler learning matter and examples than I've discovered in the Example Pack 2.

Any suggestions for a novice?

THANKS!
_________________
It continues to amaze me, how often the solutions to seemingly complex problems are so very simple.
View profile  Send private message
peterr


Posts: 5971
Posted: 10/04/2005, 2:20 PM

The file upload component automatically takes care of uploading files and it writes the filename to the corresponding record. So all you need to do is to drop the FileUpload component onto your record form.
I recommend that you experiment with this by modifying the "EmpsRecord" page in the Employee Directory example. Just replace the last field "Picture" with the FileUpload component and set the following properties:
Caption: Picture
Control Source: picture
Temporary Folder: %TEMP
File Folder: pictures
Then create the "pictures" subfolder under the folder where you Web application resides on the Web server, for example "C:\Apache2\htdocs\EmployeeDirectoryt\pictures"

Displaying the images on other pages is quite straightforward as well. Create a new grid or modify the "Default" page in the above example by adding a new column, then drop the "Image" component into it, then switch to the HTML mode and change {Image1} to pictures/{Image1}

Creating a gallery layout is litle more diffuclt but was discussed here and I think that you may be able to find a solution. Resizing images may also be more difficult or may even require some external component for image processing.
But first I recommend that you start with the above steps to understand the basic process of uploading and displaying images.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.