diff --git a/restws_file.module b/restws_file.module
index e552ba2..1930f51 100644
--- a/restws_file.module
+++ b/restws_file.module
@@ -115,6 +115,10 @@ function restws_assign_fids($type, $field_name, array $fid_array, &$payload_obj)
  */
 function restws_file_create_files($type, array $base64_data_array, array &$fid_array) {
   foreach ($base64_data_array as $enc_contents_item) {
+    if (!is_string($enc_contents_item)) {
+          array_push($fid_array, $enc_contents_item);
+          continue;
+    }
     // Get base64 MIME type and data.
     $result = preg_split('/^data\:(.*)\;base64\,/', $enc_contents_item, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
     $mime_type = $result[0];
