Retrieving File.ID from uploaded file once saved

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

I have a bunch of dynamic values Im attempting to load files for,
However I can’t see how to get the File->ID of the upload once it is saved to the database (which is working correctly) and I can save statically to a particular column if desired.

Currently Im loading the UploadField to the form dynamically which uploads to the File table, but is there an event (After upload) or similar I can use to assign the uploaded files ID to a project (based on the uploadfield being named in a key base structure for reference).
OR alternatively are associative entities possible to model in the silver-stripe data extensions - if so where is a good reference for a relationship

[File]->ID - Zero One or Many
[Project_File]->FileID/ProjectID - Zero One or Many
[Project]-ProjectID.

Are you able to post a bit of code showing the form handler, the relations to file, etc.? It might make it a little easier to understand how to get what you need.

	$field = new UploadField($name);
	$field->setTitle($title);
	$field->setRightTitle( "Upload" );
	$field->folderName = "Projects/" . Project->ID;
	$field->getValidator()->allowedExtensions = $allowedExt;
	$field->getValidator()->setAllowedMaxFileSize( 800000 );
	$field->setCanAttachExisting(false)->setCanPreviewFolder(false)->setOverwriteWarning(false)->setAllowedMaxFileNumber($limit);
	$field->relationAutoSetting = true;
	$field->addExtraClass( 'files'.($extraClass ? (' '.$extraClass) : ''));
	$fields->push( $field );

The file is related via an associative entity? i.e. Project_File which has a projectID and FileID.
On upload of the above, I would like to insert the record for the FileID saved against the ProjectID.
The ProjectFile also has a value for the type of file it is, Gannt, Req Spec etc etc. which needs to be assigned to the associative record, I can’t see how this would be possible using the $many_many etc configurations - if it is at all.

Update on the form controller, does provide the information but is after a POST (Update button click), not the Ajax Upload completion - so would like to know how to bind an action to the Ajax Upload so I can assign the ID correctly.