MarcomCentral (PTI) and FusionPro User Communities

MarcomCentral (PTI) and FusionPro User Communities (http://forums.pti.com/index.php)
-   Formatting Text (http://forums.pti.com/forumdisplay.php?f=32)
-   -   Return Graphic File Name (http://forums.pti.com/showthread.php?t=5318)

gdellaiera March 20th, 2019 11:38 AM

Return Graphic File Name
 
Hi, I'm trying to return a file name from a graphic upload and I'm not sure where to start with this. Ideally, I'd like to just create a blank rule that says if Field (x) = "", return ""; else return "uploaded file name only" (not the image, as this will be in the graphic frame.

Is this something doable?

Alex Marshall March 21st, 2019 09:12 AM

Re: Return Graphic File Name
 
return CreateResource(Field("image name").replace(/\..+$/,''));

Dan Korn March 21st, 2019 11:00 AM

Re: Return Graphic File Name
 
You should just be able to return the entire field value from a Graphic rule and assign that rule's name to your graphic frame.

That said, if you really do need just the file name, you can use the GetFileName function:
Code:

return GetFileName(Field("YourFieldName"));

gdellaiera March 25th, 2019 10:04 AM

Re: Return Graphic File Name
 
Thanks guys for the direction Alex/Dan.

Dan, I've got the images showing up, but since there are multiple images in the template, the shop guys would like a page that names locations and which file goes with it.

Dan Korn March 25th, 2019 12:55 PM

Re: Return Graphic File Name
 
Quote:

Originally Posted by gdellaiera (Post 21793)
Dan, I've got the images showing up, but since there are multiple images in the template, the shop guys would like a page that names locations and which file goes with it.

I need to know more about the context in which this job is running. In your original post, you say, "I'm trying to return a file name from a graphic upload." What do you mean exactly by a graphic upload? Upload to what? Is this from a web form? If so, in what web application? MarcomCentral? EFI Digital StoreFront? Some other web app? Or something else?

Also, what do you mean by "names locations?"

gdellaiera March 25th, 2019 12:59 PM

Re: Return Graphic File Name
 
Dan, I'm running the template in WebCRD for garment printing. Its got 3 pages, the first 2 contain a variety of image locations. The third page purely is to label which location gets which file. Just looking to grab and write down data.

Your advice worked perfectly for what I was looking to do and its doing just what I need.

return GetFileName(Field("YourFieldName"));

Thanks for the help.


All times are GMT -7. The time now is 07:17 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.