I believe your difficulty is in using GetAsText directly as the filename. GetAsText returns more than just the filename when applied to a container field. This example is from the Help file:
You'll need to parse out the filename from the results of GetAsText in order to get the result you need. I suggest using the Data Viewer on a few of your records to see what the GetAsText function is returning; that will give you a place to start.