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 -> ASP

 Issues with the file upload component

Print topic Send  topic

Author Message
Livinus

Posts: 48
Posted: 07/14/2008, 11:10 AM

Hi Guys

Can any body help me out with a challenge I have been battling with.

I successfully implemented the file upload component in my CCS 3.0 project so that I can upload files and the file names are stored in a table in a database. I however want to be able to list the names of the uploaded files in a grid form with each item in the list as a hyperlink to the uoloaded files so that my site users can click on any of the links to download the corresponding files.

Please help!

Livinus

liviemama@micronicslimited.com
View profile  Send private message
Chris__T


Posts: 339
Posted: 07/14/2008, 11:29 AM

You'd probably implement section 1 (FileUpload) of the File Upload example with your grid.
View profile  Send private message
Livinus

Posts: 48
Posted: 07/15/2008, 3:21 AM

Hi Chris, thanks for your response. I don't quite understand what you meant. Could you please give me some details. Regards.

Livinus
View profile  Send private message
Chris__T


Posts: 339
Posted: 07/15/2008, 11:32 AM

If you look at the example page for FileUpload, and add a file, it lists it above "attach relevant documents". The code that displays your files can be used in your grid

Page 1 (FileUpload):  
  
   1. Create a new page.  
   2. Use Grid and Record Builder to create the grid and record forms based on the employees table.  
          * On step 2 of the builder select emp_name and title fields for the grid.  
          * On step 6 of the builder select the fields you'd like to use for the record form.  
   3. Set the Remove Parameters property of the Employees1 record form to emp_id  
   4. Within the record form add Hidden control TempID and set its Data Type property to Integer .  
   5. Insert a new row into the record form (select "Insert row" from the context menu shown on the   
      right mouse click) and move it below the zip field row (ALT + Arrow Down).  
   6. In the left cell of the new row, enter the text 'Relevant documents', then in the right cell   
      insert a table (from the "Table" toolbar or menu) with the following parameters: Rows=1, Column=1, Border size=0.  
   7. Switch to HTML mode and within the <TABLE> tag add the attribute id="AttachedFiles".  
   8. Insert new label called AttachedFiles after the <TABLE> tag and set its Content property to HTML.  
   9. Insert new link inside the new table and set its Href Source property to javascript:OpenPopUpList(),   
      Preserve Parameters property to None, and Default Value property to "Attach relevant documents".  
  10. Create or copy programming code for the record's Before Show, After Execute Insert, After Execute   
      Update, Before Execute Delete events, as shown in the example.  
  11. Make cosmetic changes as needed, by modifying the text and captions within the HTML.  

You're basically making a table within your grid, and this populates that table, so it refrences the table that holds your uploaded files.
View profile  Send private message
Livinus

Posts: 48
Posted: 07/17/2008, 8:29 AM

Hi Chris,

I'm still to achieve success with the file upload component. I followed you instruction as put foward in your previous post on the topic but after building the forms they dont run well. In part 1 of the example when I click the "Attach relevant files" link a javascrip error bumps our. Debug reveals the the error is coming from the Java scrip function OpenPopUpList().

Part 2 (fileattacment): The form I created comes up also with the error that has to do with javascript onclick attached to the delete link.

Please any further help is appreciated.

Regards

Livinus
View profile  Send private message
Chris__T


Posts: 339
Posted: 07/17/2008, 9:32 AM

In the example files (actual files with code), there are a few javascript snippets and html editing to do. I'll have to find where they are at, or you can look in the excample code files to find them.
View profile  Send private message
Livinus

Posts: 48
Posted: 07/22/2008, 11:29 AM

Hi Chris,

I cannot locate the example file u wrote about. Can u direct me on how to get it.

Regards.

Livinus

View profile  Send private message
Chris__T


Posts: 339
Posted: 07/22/2008, 1:17 PM

http://examples.codecharge.com/

Go there and scroll to this part:

Additional Examples - CCS Example Pack 2  
The examples below make up CCS Example Pack 2, available only to CodeCharge Studio users in CodeCharge Studio User Area. 

the last part, "CodeCharge Studio User Area" is a link. Go there and enter your serial number for your CCS program. It will take you to download section to download the example pack. Then open the example pack in CCS, and find the folder for file upload.
View profile  Send private message
Waspman

Posts: 948
Posted: 07/28/2008, 2:56 AM

You sorted this Livinus?

Just build a grid showing your list, change the file name to a link and then change the Href type to be Database and the Href source to the name of the field.

Then add any path amends to the Format/Href field in properties i.e.

uploaded/files/{link_scr}

That'll do it...

T
_________________
http://www.waspmedia.co.uk
View profile  Send private message
Livinus

Posts: 48
Posted: 07/28/2008, 7:15 PM

Hi waspman

I could not implement the following last steps in your recommendation


"Then add any path amends to the Format/Href field in properties i.e.

uploaded/files/{link_scr}"

Could you explain further . Where do I get the Format/Href in properties. I am using codecharge 3.0.

Regards.

Livinus
View profile  Send private message
Waspman

Posts: 948
Posted: 07/28/2008, 11:49 PM

In the properties box go to the format tab then in the "href" field add any path amendments like..

uploads/product/{Image_Scr}

Or

add code to the before show event of the field i.e.

Uploads.Image.Value= "uploads/product/"&Uploade.Image.Value

Hope this helps...


T


_________________
http://www.waspmedia.co.uk
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.