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

Trimming the file name fromt the path

LEGEND ,
Aug 04, 2006 Aug 04, 2006

Copy link to clipboard

Copied

I am using cffile to upload an image to the database. I need to figure out a
way to only store the filename in the database verses the path. How can I do
this?

<cffile action="upload" accept="image/gif, image/jpeg, image/jpg, image/png,
image/psd" destination="E:\webs\website.com\main\clients\logos"
filefield="form.logo" nameconflict="makeunique">


--
Wally Kolcz
Developer / Support


TOPICS
Advanced techniques

Views

348

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
Contributor ,
Aug 05, 2006 Aug 05, 2006

Copy link to clipboard

Copied

CFFILE returns a set of variables with information about the upload:

Directory: #File.ServerDirectory#
Server File Name: #File.ServerFile#
File Size: #File.FileSize#
Time Created: #File.TimeCreated#
Time Last Modified: #File.TimeLastModified#

ServerFile is the one you want.

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 ,
Aug 05, 2006 Aug 05, 2006

Copy link to clipboard

Copied

To be able to use any of those, you would want to enter the cffile prior to
the cfquery INSERT, correct? Would you then set the #File.ServerFile# to a
variable so it can be inserted?

"dempster" <webforumsuser@macromedia.com> wrote in message
news:eb2e4k$13v$1@forums.macromedia.com...
> CFFILE returns a set of variables with information about the upload:
>
> Directory: #File.ServerDirectory#
> Server File Name: #File.ServerFile#
> File Size: #File.FileSize#
> Time Created: #File.TimeCreated#
> Time Last Modified: #File.TimeLastModified#
>
> ServerFile is the one you want.
>
>


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
Engaged ,
Aug 06, 2006 Aug 06, 2006

Copy link to clipboard

Copied

LATEST
Yes.
Do your uploading using CFFILE. Once the code completes that section, it will give your variables that you can use in the code .
Now do your cfquery and use the variables that CFFILE created.

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