I have an object containing a field named "Upload Document".
I choose the file and saved the record.
but in the record page in that field it is showing as "core.filemanager.FileBlobValue#1c6257a4".
what is the reason?
Thank you.
Related
What Object or Table in SFDC starts with and Id prefix of 0EM?
I have uploaded an image into a Knowledge__kav object in Salesforce, which is basically the knowledge article page.
And when I open the link to the image, it gives an Id starting with 0EM.
But, what table does the Id starting with 0EM relate to?
The label for the object is Other Uploaded Images and Files
I uploaded it into Content Version instead and referred to the url as img src.
I need to create entity object programmatically and fill it with data. One field needs to be of a file type. So I managed to create entity without file, upload file in ADAM using this sample of code. However it seems that I didn't bind it as it is binded when file is uploaded manually.
When a file is uploaded to entity field manually, you can see content like file:421 .../asdf.docx. However when I repeat code sample from link above, field contains that file available to choose and already uploaded, but field value is null. IFile.Url seems to write correct data via App.Data.Update method, but no id is displayed in admin panel.
Dictionary<string, object> fileDict = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase) {
{ "File", file.Url }
}; // file is ToSic.Sxc.Adam.IFile, returned by SaveInAdam
App.Data.Update(entityObj.EntityId, fileDict); // entityObj is ToSic.Eav.Data.IEntity, returned by App.Data.Create
I wonder if that's going to have some bad conscequences if it has no binding like manual upload and how to do that correctly?
To add files, you actually add them to a field (so that the UI can then offer them as if they were added by a normal user). Check out https://docs.2sxc.org/api/dot-net/ToSic.Sxc.Dnn.Web.IDynamicWebApi.html#ToSic_Sxc_Dnn_Web_IDynamicWebApi_SaveInAdam_System_String_System_IO_Stream_System_String_System_String_System_Nullable_System_Guid__System_String_System_String_
BTW: Best check out MobiusForms to see how it's done.
And I forgot to mention: here the docs https://docs.2sxc.org/web-api/custom-web-api-dotnet-saveinadam.html
To further explain:
SaveInAdam will place the file in the ADAM folder of the item. Since it could be that many files are added, it's just assuming that the field will be the library type - which doesn't store anything in the entity, it just automatically finds the folder that belongs to the field.
If you wish to not use the library feature but actually just the single-field with link, then you must also save the term like "file:74" into the value of the field.
I have created a custom code that overrides the default "Send an Email" button on Contact object.
In case of standard button, when we select "My Computer", browse any file and click on "Attach file" button , it gets saved somewhere.
Can anyone tell me where is this file getting saved in my org ? Is there any standard object that is not visible ?
You need to share your code for a exact answer.
If you are creating a Attachment object in your code and setting the parentID to the ID of the contact, then the attached file if uploaded successfully will show up under the Notes and attachments related list.
You may not have this list on the layout, and may need to add it to the layout to see the record.
I have created an attribute set with some attribute in Magento. I need a file browse button in that product attribute set,and I need to show the file in the front end.Is it possible with attributes?
I am afraid there is no attribute type to upload file in magento. But if you are talking a file as if it is an image then there is an attribute type called Media Image.
Hope this will help.
I'm dynamically creating some PDF files through my application, using iText, and I need to use several components (TextField, CheckBox, RadioButtons etc), and then submit the values to server. But, one of the requirements says that the user needs to be able to select and send files along with the other values. I did not find a specific component to this, and so I'm asking for some help with this situation.
Is there a way to create some kind of Input File, File Chooser, etc, and attach it on the generated PDF file? And then send this selected file to server?
Thanks
This is explained in the official documentation, more specifically in the example FdfServlet of chapter 9 of my book. However, in this example, we add a file selection field to an existing PDF, so I've made you an example that explains how to create such a field when creating a document from scratch: FileSelectionExample
A file selection field is created just like any other text field, except that you have to set a flag using the setOptions() method. If you want a file chooser to appear, you also have to add a JavaScript action:
TextField file = new TextField(writer, new Rectangle(36, 788, 559, 806), "myfile");
file.setOptions(TextField.FILE_SELECTION);
PdfFormField upload = file.getTextField();
upload.setAdditionalActions(PdfName.U, PdfAction.javaScript(
"this.getField('myfile').browseForFileToSubmit();", writer));
writer.addAnnotation(upload);
In the full example, I also added a second field and after selecting the file with the browseForFileToSubmit() method, I set the focus to that other field. I'm doing this because the file name only becomes visible in the file selection field after that field loses focus.