Capture the URL path of image upload
I have a multi section editor called "video" created for uploading a mp4, wmd, ogg videos. In this section editor I also have a field for uploading a video poster image. I know I can use the code generator to get the foreach loop to load the video poster... but that will not work for this particular scenario.
So, I need to create a method that when a video poster image is uploaded and the record is saved, the URL path to the image is added into a text field call "video_poster_url" -OR- a method to find the uploaded video poster and connect it to the videos by matching up the section editor and upload by the nums.
I was thinking about building an add-on to do this, but haven't a clue where to begin to build such an add-on to capture the image URL path. Anyone have any suggestions on where to start?
If your video records contain an upload field for video files and another upload field for the poster, the uploads should be linked to the video record already by default. To get the uploads you can either use getRecords() function with 'loadUploads' to be true, or just call getUploads($tableName, $fieldName, $recordNum). And the url path of the uploads will be the value of 'urlPath' key in the relative upload data.
Hope this answers your question.