gdellaiera Posted March 20, 2019 Posted March 20, 2019 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? Quote
Alex Marshall Posted March 21, 2019 Posted March 21, 2019 return CreateResource(Field("image name").replace(/\..+$/,'')); Quote
Dan Korn Posted March 21, 2019 Posted March 21, 2019 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: return GetFileName(Field("YourFieldName")); Quote
gdellaiera Posted March 25, 2019 Author Posted March 25, 2019 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. Quote
Dan Korn Posted March 25, 2019 Posted March 25, 2019 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?" Quote
gdellaiera Posted March 25, 2019 Author Posted March 25, 2019 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.