Upload Multiple Assets to an Entity - apigee

On documentation it is said that Only 1 asset can be attached to an entity. Is there any way to attach multiple images to an entity?

Currently this is not possible. You can work around the limitation by using folders, and connecting them to a user or other entity:
Linking a folder to an asset
In order to access the asset for the image in the folder, you need to link the folder to the asset. You can do that by issuing a POST request in the following format:
POST /{org-uuid}/{app-uuid}/folders/{folder-uuid}/assets/{assets_id}
where {folder-uuid} is the UUID of the folder, and {assets-uuid} is the UUID of the assets entity.
Here’s how you could link the folder and the asset you created for the my-image.jpg image:
POST https://api.usergrid.com/my-org/my-app/folders/6640a601-2ac6-11e2-92c3-02e81ae640dc/assets/9501cda1-2d21-11e2-b4c6-02e81ac5a17b

Related

Adding additional Metadata field in AEM-DAM

I want to add a custom metadata field in DAM assets, is there any way to add custom metadata apart from overlaying a workflow or writing custom workflow?
Metadata profiles is the way to add default properties to assets on upload. Metadata profiles are linked to assets at folder level. You could have different default properties for assets based on folder they are uploaded to. For e.g. attached default tags based on folder
Checkout this link for the detailed documentation on how to add metadata profile to a DAM folder
Metadata Profiles

How to reference a file (e.g. testaudio.mp3) from another file (e.g. index.html) in Alfresco

I have a mp3 file in a folder called "audio" in Alfresco. I would like to have a link that points to that file in my index.html file which resides in another folder.
For example: <a href="pathToTheFile>test song 1</a>
How would I reference that file? I tried with href="/share/proxy/alfresco/api/node/content/workspace/SpacesStore/xxx-xxx-xxxxx/testMP3.mp3" and it does not work. Or is it even possible with Alfresco? I am using the web interface.
My apologies for not making myself clear. I am using Alfresco Explorer Community Edition for management, and the website I'm working on is based on Spring MVC and pulls content from index.html files in Alfresco.
Currently I need to use <embed> tags to include a mp3 file to index.html, and the mp3 file is also stored within the Alfresco repository but in a different folder.
How would I reference the mp3 file from the index.html file? The referencing has to work when the index.html is deployed to the client website, and currently the client website is referencing files in Alfresco in the following manner: <img src=/asset/xxxxxx-xx-xxx/test.png>(There is no asset folder in the Alfresco repository, and somehow that works...). But this does not work for my mp3 file...
To access alfresco content using the RESTful api, you should be querying this webscript: /alfresco/d/<d|a>/<workspace>/<store>/<nodeId>/<filename>
where :
d and a refer to direct / attached mode
<workspace>, <store> and <nodeId> reference your content nodeRef
<filename> a file name of your choice
So your URL should look something like this http://<host>:<port>/alfresco/d/d/workspace/SpacesStore/8444ad61-4734-40e3-b2d4-b8b1c81347fd/test.mp3
Note : Depending on the permission set on your node, you might need to attach an alf_ticket to the URL for an authenticated alfresco user. Please check this for further insights.

how to upload a complete directory structure to artifactory using customized property?

How to upload a complete directory structure to artifactory using customized property?
I have to upload a complete hierarchy structure in Artifactory using customized property
Not sure what "customized property" is, but in general you have 2 options:
Upload from server, which is essentially, repository import. You point Artifactory to a directory on the server and it sucks everything in.
Upload from client, which is essentially, archive deployment. You pack your files in an archive and then deploy. Artifactory will unpack the file to the correct repository, keeping the directory structure.
I am with JFrog, the company behind Bintray and [artifactory], see my profile for details and links.

How to make files available as a download link in asp.net?

In my asp.net website, users can upload multiple files, which reside in 'upload' folder on server's hard drive. I am saving the files by renaming them with username + original file name
Example : if I upload file 'user.text' and my code is 1000, then the file will be saved in upload folder with name '1000_user.Text'. This is for identification of file against a particular user.
Now, when admin logs in application and selects a user, he should be able to see all files uploaded by him/her. Files should be in downloadable format to him.
How can I achieve the same? I have totally no idea, how to go for it ?
This is not how you ask a question on SO. Anyway already a piece of advice :
Store your files OUTSIDE of the webroot, and use a script in your website to get the files and render it to the user. This is for security reason : if someone manages to upload a malicious file, you don't want him to be able to execute it from the web.
Store file info and upload info in a database : who uploaded what and when ? Relying on file name isn't a good idea. You could also store the file in the database eventually (as a BLOB), but I prefer the good old filesystem
I can suggest you couple of ways based on feasibility. Approach 1 - If you can make database changes, when user is uploading a file you should save dynamically generated filename against the user in database. This way when admin logs in and wants to see all the files uploaded by user, you just need to make a database query and show them in a grid. When user clicks on the file name, you can fetch the file from harddisk and allow it to download to admin.
If database change is not feasible, your task will be more difficult. You will have to query in your directory with username in all the files. You can make use of LINQ to make this task little easier to you. Once you have got all the list, show it to admin.
I would recommend you to save metadata about the file on the database (like original file name and username). Then you could use this metadata to find the files that the user have uploaded. Give the files a file name on disk that is based on a unique ID in the database table. That way a user can upload several files with the same name. Make sure that this folder is not located within you application so that they are accessible with a url for security reasons.
The most recommended way to achieve this is to use a database, it is same as a module of Gallery where a user has albums and some pictures in albums. Admin can view each user's album and pictures in the album. you have to introduce two tables in your database. I having the category information of files being uploaded (master table) and other table having the info about the files itself (details table).
The other way is to create a hierarchal folder directory for each user for file categories in your application and then recursively read the directories and fields and then list them up to show them to application users. this would be costly i guess when number of files will increase.

Drupal6: I need to customize file upload links in node edit form

I am customizing the node/add and node/edit forms of a content type with a form_alter. In my content type, there is a file field that permits to upload files to the content.
What I would like to do is to customize the file box by changing the link to the file that is composed at runtime with Ajax. How can I do it without modifying Drupal core?
Your Private Files directory should not be in the docroot. Hiding it with a .htaccess rule will not work, as you point out in a comment.
Say you have Drupal in /var/www/sites/example.com/, then you should not store your private files under that directory; /var/www/sites/example.com/sites/default/private/files/ is just plain wrong.
You should, instead store the files where apache will not serve them, but can read them. E.g. in /var/www/files/example.com/. Then change the setting in Drupal to use that absolute path.
If you are running a large(r) site, you will probably want to store your files on a dedicated mount (drive, NFS etc.), say /media/nfs-example-com/.
Try Filefield Paths:
The FileField Paths module extends the default functionality of Drupals core Upload module, the FileField module and many other File Upload modules by adding the ability to use node tokens in destination paths and filenames.
http://drupal.org/project/filefield_paths

Resources