General discussion


ColdFusion Help Please!

By QTX ·
Hello people,

Could someone show me a way to upload files into Access database with ColdFusion please? I know how to upload files to a server with <cffile> tags, but I want to create links in the record fields of Access database. This way, when the data is presented to users by ColdFusion in tables and forms, they can click on these links to download or open files. These links have to be updatable as well.

Another question is: I can use "wrap" attributes of the <cfform> tags to make user-entered data appear on different lines if ENTER key is pressed. But how do I make data appear on different lines in tables? Are there any ColdFusion tags that I can use to let users change font size and color? Help me, please!



This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by Dr Dij In reply to ColdFusion Help Please!

I think you'd have to upload the file to server then open it and read in each record, and write a database you have a cold fusion dsn for.

Collapse -

by tim In reply to ColdFusion Help Please!

Hi Tracy,
I am sure you have found your answer by now. But if not. i can help.

question 1)
THe other post is half way right. you have to upload the file, then read the file (in a readable format i suggest CSV) read the file with CFFILE action="read"

Then loop of the red file, you will have to do 2 loops, the outer loop will loop over each line, the inner loop will loop over each field in the CSV.
THis is were you would insert or update the records.
After the loops then update the record(s) again with the path to the file #ExpandPath(file)#..
You can also have another field that just has the file name or a web based or URL based path to the file if you want users to be able to download it, otherwise you will have to get fancy with some cfif statements.

If all you want to do is upload lets say an MP3 file instead of a data file, then after the cffile action=upload.. save the file path into the db record as explained above.

Question 2)
in IE (textarea wrap="hard") not sure in other browsers..
Then in your display of that data use pre tags (html) this will cause your pre formated text to display properly. If you are asking how to make the different rows in the textarea data appear in totaly different areas of the page, then you will need to make the data into an array or a list delimieted with the CR chr(10) or chr(13). this will give you a var that has all the different rows of data in a easily usable variable.
cfset txData = listtoArray(form.text,chr(10));
now txData[1] will have the first row of text and so on.

Question 3)
there are no CF tags that will do this, or at least not in CFMX 6.1 and below. In CFMX 7.2 you can build your UI in FLex and it has a richText editor.

THere are some free richText editors out there you can download and implement but none are CFTags. you could make one into a custom tag i have a few like this.

Anyway, sorry i am a day late and many dollars short :)
Cheers and happy CFing.....


Related Discussions

Related Forums