mstellaclmarketing.com Posted June 20, 2014 Share Posted June 20, 2014 Hi, I have a text frame I am using to build a business card. It is up to the customer to upload a logo or use the business card without. I have the rule "Logo Upload" below inserted into the text frame to check to see if the file exists but when the graphic does exist I get this "ÿØÿàÿØÿà" instead of the image. I assume it is because I am not assigning the file extension in the code but I have no way of knowing what file/image type the customer is going to upload of the 5 we allow. I am using FusionPro VDP Deisgner 8.2.7. var website = Field("URL") + "/Merchant5/s01/attr_uploads/basket_" + Field("BASKID") + "/"; Pic = CreateResource(website + Field("attribute2") + "", "graphic", true); return CreateResource(website + Field("attribute2")); Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 23, 2014 Share Posted June 23, 2014 I have a text frame I am using to build a business card. It is up to the customer to upload a logo or use the business card without. I have the rule "Logo Upload" below inserted into the text frame to check to see if the file exists but when the graphic does exist I get this "ÿØÿàÿØÿà" instead of the image. I assume it is because I am not assigning the file extension in the code but I have no way of knowing what file/image type the customer is going to upload of the 5 we allow. I am using FusionPro VDP Deisgner 8.2.7. No, it's not because of the extension. You have to get the URL right, of course, including the extension, if any, to be able to download the Internet resource properly. But FusionPro doesn't rely on file or URL extensions to determine the type of a graphic resource; it scans the file to figure out the graphic format. It does, however, do something different depending on whether you specify a text or graphic resource. By default, CreateResource creates a text resource in a text rule. The problem is highlighted below: var website = Field("URL") + "/Merchant5/s01/attr_uploads/basket_" + Field("BASKID") + "/"; Pic = CreateResource(website + Field("attribute2") + "", "graphic", true); // <- this creates a graphic resource return CreateResource(website + Field("attribute2")); // <- this creates a text resource in a Text rule Why do you have that second call to CreateResource in there? You're creating a graphic resource with the first call to CreateResource, but then you're throwing that away and creating a text resource with the second call to CreateResource, and returning that text resource. Just change the rule to this: var website = Field("URL") + "/Merchant5/s01/attr_uploads/basket_" + Field("BASKID") + "/"; var Pic = CreateResource(website + Field("attribute2"), "graphic", true); return Pic; Or this: var website = Field("URL") + "/Merchant5/s01/attr_uploads/basket_" + Field("BASKID") + "/"; return CreateResource(website + Field("attribute2"), "graphic", true); And it should work, as long as the URL is valid. Quote Link to comment Share on other sites More sharing options...
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.