• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cffile author,comments and other attributes

Participant ,
Jul 09, 2007 Jul 09, 2007

Copy link to clipboard

Copied

I would like to upload the author name, comments and other data with the cffile action=upload. Anyone already solved this or has a way of doing this?
TOPICS
Advanced techniques

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 11, 2007 Jul 11, 2007

Copy link to clipboard

Copied

Something like this:

<form action="next.cfm" method="post" enctype="multipart/form-data">
Author: <input type="Text" name="author"><br>
File: <input type="File" name="aFileName"><br>
<input type="Submit" value="ok">
</form>

Then on your processing page, you'll have access to all the form fields (including the file name that you can upload with cffile.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 12, 2007 Jul 12, 2007

Copy link to clipboard

Copied

thank you so much for taking the time to help me out.
I am willing to know how to attach an author name in a cffile attribute.
Namely: when I use cffile in a cffunction such as:

<cffile action="upload" filefield="filedata" destination= "#destination#" nameconflict="makeunique" accept="application/octet-stream"/>

how can I hope to find a way of attaching attributes such as author and other attributes to the file being uploaded?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 12, 2007 Jul 12, 2007

Copy link to clipboard

Copied

AFAIK you can not attach those attributes directly to a file.

Normal practice is to have a database table which has the data inserted for each file uploaded.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 20, 2007 Jul 20, 2007

Copy link to clipboard

Copied

John
When I query the file object I have
Attributes
DateLastModified
Size
Type
Mode
Name
However you know that every file has a list of references in its properties in which you can see the
author name
commentary
and some more attribtutes attached.

How do I access these attributes is the question.

Since we can access them through a windows file explorer we should have these somewhere?


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 21, 2007 Jul 21, 2007

Copy link to clipboard

Copied

Goingflex wrote:
When I query the file object

With which code?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jul 21, 2007 Jul 21, 2007

Copy link to clipboard

Copied

I suspect they're using cfdirectory based on the list of attributes (DateLastModified, size, type, mode, name ...)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jul 20, 2007 Jul 20, 2007

Copy link to clipboard

Copied

> How do I access these attributes is the question.
> Since we can access them through a windows file explorer we should
> have these somewhere?

Not with CFFILE. Those are windows o/s extended file properties. Afaik, you'd need some sort of activeX control to access those properties.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 21, 2007 Jul 21, 2007

Copy link to clipboard

Copied

Hi guys

cf_dev2 is correct. I use:

<cfdirectory directory="#presentdirectory#" name="subdirectoryQuery" sort="Name ASC" filter="*" recurse = "no">

Here I look at the type="file" only and have the attributes mentionned above.

How do you gentlemen think I can get the other attributes? I am far from a windows man and activex and stuff is chinese to me.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 22, 2007 Jul 22, 2007

Copy link to clipboard

Copied

Goingflex,
Neither cfdirectory nor cffile will be of any use here. One way to go is Apache POI - HPSF - Java API. I hope the following example works for you, too.

P.S.:
To download the Apache POI application, go to Apache POI mirror closest to you ( http://www.apache.org/dyn/closer.cgi/poi/release ). Open the bin directory and download the appropriate file for your operating system. For example, I am on Windows, so I downloaded poi-bin-3.0.1-FINAL-20070705.zip.

Extract the file and copy the directory poi-3.0.1-FINAL to {CF_INSTALL}/lib/thirdpartytools. For the usual Coldfusion installation of MX7 on Windows, {CF_INSTALL} is C:/CFusionMX7.

Restart Coldfusion.




Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 22, 2007 Jul 22, 2007

Copy link to clipboard

Copied

LATEST
Hi BKBK

thanks for the time spent responding. I appreciate it very much.

I will take a look at it and try it out.

Regards and thanks to all who tried to help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation