You need to sign in to do that
Don't have an account?
jphale
Unable to upload a Base64 encoded image using v20+ of the API.
I can upload encoded image data using v19 of the API. Any idea what the change is that I am missing? I get the following error:
Invalid data specified, the provided data does not seem to be a valid image: [B@574b1c
and
INVALID_DATA_URI
Again, if I use v20/21 I get the error, if I use v19 then all goes well and I see my image.
Thanks
You can post an example of your request? sounds like this is an image in a rich text field ?
Correct, Within Adobe Flex, I have encoded a jpeg to Base64. Since Rich Text Fields are not supported by the sync in the Force For Flex toolkit, I chose to upload seperately via a standard com.salesforce.connection. I am using the following sandbox URL.
https://test.salesforce.com/services/Soap/u/19.0
if I use 20.0 or 21.0 I get the error mentioned above. The string that I am passing to the create() in my custom object to a RichText Field looks like:
<img alt="Home Pict" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcU
Fh .....Many more < 32000......." />
Works like a charm with 19.0.
Posted an update, wondered if you had any further thoughts. Thanks
I haven't been able to reproduce this yet. can you provide some more details (e.g. image size/format). If you have a standalone app that demonstrates this, that'd be great.
Simon, My apologies. I left out the critical piece of info. I am working with the forceforflex toolkit within Adobe FlashBuilder 4. I have been able to do quite a bit creating an offline AIR app. Here is the declaration:
<flexforforce:F3DesktopApplication id="app"
statusChanged="statusChangedHandler(event)"
loginComplete="_login.loginCompleteHandler(event)"
loginFailed="_login.loginFailedHandler(event)"
sessionExpired="_login.sessionExpiredHandler(event)"
serverUrl="https://test.salesforce.com/services/Soap/u/19.0"
requiredTypes="Account,Contact"/>
If I change the serverURL to a more recent versiojn of the API the syncing of the data fails as mentioned above.
I have also tried with a driect connection rather than the built in sync:
When I use an API higher than 19 the create() or update() on the rich text field fail.
Thanks again.
The different problems I had was android was word wrapping (which the pc browser did not care about but salesforce did) and some formatting issues