Hello,
You can try to use the CMS.MediaLibrary.MediaFileInfoProvider.GetMediaFileInfo(String, String, String) to get the MediaFileInfo instead of your current approach so you won't need the GUID to obtain the info object. Within this object is everything you need to know about the media file you are working with. For more information on the mentioned methods and objects please
our API documentation. If you still want to save the GUID instead of the path you can create a custom form control which would save you the GUID into the database as described in the following
article. You can check how we are implementing the form controls in the CMSFormControls folder.
Best regards,
Boris Pocatko