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

Multiple Uploads

LEGEND ,
Sep 11, 2006 Sep 11, 2006

Copy link to clipboard

Copied

I have a page where the user can update a page and upload 1 audio file and 2
photos for a streaming radio show.

I can use cffile to upload the 3 items, but how can I caputure just the file
names for each using cffile.serverfile?

I know that I can use cffile.serverfile in a single enviroment, but when 3
unique items are being uploaded, would I have to write 3 cffiles uploads,
followed by 3 updates queries so that each doesn't overwrite the previous
cffile.serverfile?

Is there a way to make them unique so I can first upload the 3 files and
then insert them into a database?


TOPICS
Advanced techniques

Views

277

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
LEGEND ,
Sep 11, 2006 Sep 11, 2006

Copy link to clipboard

Copied

With MX 7 or later you can. The cffile tag now has a 'result' parameter
that you can use to name the structure for the file details.

<cffile action="upload" result="fileOne" ...>
<cffile action="upload" result="fileTwo" ...>
<cffile action="upload" result="fileThree" ...>

<cfdump var="#fileOne#">
<cfdump var="#fileTwo#">
<cfdump var="#fileThree#">

Previous to MX 7 you would have to do what you described, upload the
file and access the file structure. But you could copy the structure at
this time for later processing.

<cffile action="upload" ...>
<cfset fileOne = duplicate(file)>

<cffile action="upload" ...>
<cfset fileTwo = duplicate(file)>

<cffile action="upload" ...>
<cfset fileThree = duplicate(file)>

<cfdump var="#fileOne#">
<cfdump var="#fileTwo#">
<cfdump var="#fileThree#">

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
LEGEND ,
Sep 11, 2006 Sep 11, 2006

Copy link to clipboard

Copied

Thanks for the info...

So if I wanted to insert the cffile.server (or just the file name without a
path) how can I do it using the results attribute?


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
LEGEND ,
Sep 11, 2006 Sep 11, 2006

Copy link to clipboard

Copied

Thanks for the info...

So if I wanted to insert the cffile.serverfile (or just the file name
without a path) how can I do it using the results attribute?


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
LEGEND ,
Sep 12, 2006 Sep 12, 2006

Copy link to clipboard

Copied

Thanks for the info...

So if I wanted to insert the cffile.serverfile (or just the file name
without a path) how can I do it using the results attribute?

The results attribute renames the file structure returned by a
<cffile...> operation.

<cffile action="upload" result="anExample" ...>

<cfoutput>#anExample.serverFile#</cfoutput>

All the status parameters that are available in the original file
structure are also available in the anExample structure.

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
LEGEND ,
Sep 12, 2006 Sep 12, 2006

Copy link to clipboard

Copied

LATEST
Thanks a ton!


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