CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Anyone mastered Upload in CCS Beta4?

Print topic Send  topic

Author Message
Aaron
Posted: 03/13/2003, 10:10 PM

Has anyone figured out the upload function in CCS beta4? I need to upload image files and rename then according to a field's contents. i.e. field content = 1234, image would be 1234.jpg.

I'm hoping to keep it all CCS, but I just grabbed an ASP upload from http://www.pstruh.cz/help/scptutl/upload.asp. I guess I'll try to integrate it if no docs, or help is forthcoming on the CCS upload.

Thanks!
DaveRexel
Posted: 03/14/2003, 2:16 PM

Hi Aaron,

I did get the file-upload in b3 & b4 to work with some issues outstanding which support have acknowledged and passed on to the developers.

in b3 the issue was that the indexing number was added to the end of the file name, YS fixed this in b3.

in b4 the issue is that the file path is not saved to db making displaying linking of files in display pages difficult. I hope they fix this prior to release.

My tests can be viewed at rexdesign.com

All tests were in PHP as my ASP web-host is having severe problems... I will try ASP project in local enviroment and report here.

If anyone has suggestions for ASP uppload-component in b4 I will try them out.

Greetings
Dave
GreggB
Posted: 03/16/2003, 9:44 AM

Well, YES… BUT… ; )

Things to know if you already don’t know.

1) Temporary Folder – This is a temporary folder on your web server (Host) for the actual file transfer process. The file in this folder is deleted after being moved to the “File Folder” path.

2) File Folder – This is the path on your web server (Host) where the file will be moved to from the “Temporary Folder”

3) File Permissions – Make sure both of the above locations have adequate file permission to write to these locations.

4) Make sure you have the correct paths in both the above for your production server. For users that are uploading to virtual web sites, it is critical for you to know the correct path i.e.
a) Temporary Folder: /home/virtual/yourdomain.com/var/www/html/TEMP
b) File Folder: /home/virtual/yourdomain.com/var/www/html/images

5) Control Source: You have the option of using the Control Source to store the image’s file name in a database. Thus allowing you to retrieve and display the image that is stored in the database. Of course at this point CCS prefixes the file name with a date, time & random number to the file name. CCS 2 b4 does not add the file path, which I prefer. All file paths are not necessarily inherent to a particular project. I retrieve a predefined stored path and the image file name from the database then concatenating them as needed in each project.

6) The Record: The Record File Upload should upload the file now with the proper paths. Once the file is uploaded the record will display the file name and it’s properties along with the DELETE checkbox once the upload feature has been used.

7) Last and not least … “This is for RonB if he hasn’t already figured it out”, that ominous DATE, TIME AND RANDOM number prefix we all hate so much. This is a pain but will allow a nice clean file name such as “image.jpg” without the prefix garbage. In the Common Files, you will need to edit the “Classes.php”.
a) Double click on the “Common Files” in the Project Explorer. This will launch the code editor with all the Common Files. Now select “Classes.php” and find “$ActualFileName = date("YmdHis") . $index . "." . $FileName; “ . I think you can see where I’m going with this now.
b) Change that line to “ $ActualFileName = $FileName; “. The downside is the field will not display the file name of the image and you will need to add Label to display the file name.

Hopefully I covered all the minimal requirements to make this work. It does work for me and hopefully it will work for you.

I love this next part ; )

That’s it. HEHEHE. That’s all there is to it… OK OK

Good Luck

I’m confused
GreggB




GreggB
Posted: 03/16/2003, 12:27 PM

A member of CodeChargers.com, “char” just made a good point about stripping off the date/time & random number prefix on the File Upload function. The date/time & random number prefix on a file being uploaded will prevents file overwrites. Depending on what your are uploading I’m sure there’s a need for both with and without the prefix.

Currently I leave the prefix on for most image file uploads but off for include pages and pages that are referenced by a predefined hard coded URL within the current project or referenced from other sites needing the name to be kept the same.

GreggB
DaveRexel
Posted: 03/17/2003, 3:35 AM

I've reported the issue to support who've passed it on to the dev-team.

Altering class files etc are workarounds and we need a native CCS solution that works, out of the box, in the IDE.

Hopefully this will be fixed in the next release.

Greetings
Dave

   


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

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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