IMPORT_FILE_ERROR

Archived from the Transloadit support forum. Originally posted on November 13, 2013; details may be outdated, see our docs for current behavior. Original thread

Hi Guys,

I’m busy tracking down an issue where we are receiving an IMPORT_FILE_ERROR error.

Example Assembly REDACTED
Reason 404 on GET http://vibedeck.com/problemaz/tracks/I7YGFTJ5xLk_2FJmfD_2Bq_2B0pg_3D_3D/stream

I can access the URL from my browser - Any assistance would be greatly appreciated.

Please note that this is not related to #8202 where we had an issue handling the failure notification.
This has been fixed.

Hey Nicolaas,

it is redirecting to a different URL. The /http/import robot follows up to 5 redirects. Could it be that there are more redirects involved here?

Any chance you can use the real final URL in the /http/import robot?

Kind regards,
Tim

Co-Founder Transloadit
@tim_kos

Hi Tim,

There is only one redirect from our service to S3 where the files are.

I’ve picked up that we are not mapping the filenames correctly on our side in some instances.

It would be great if you could give me some insight into the function used on your side to escape file names.
It looks like we might not be handling special characters the same way that you are causing our mapping to fail.

If that makes sense.

Thanks!
Nicolaas van der Westhuizen
[email blocked]

Hey Nicolaas,

do you mind sharing some file names where this occurred?

As for the filenames - S3 doesn’t allow us to push special character filenames, so for the ${file.urlName} and ${file.urlBasename} assembly variables (that you probably use), we do this:

str.urlSanitize = function(s) {
s = s.replace(/ /g, ‘-’); s = s.replace(/[^A-Za-z0-9-_.]/g, ‘_’); return s; };

So we are replacing every special character with an underscore.

Does this help?

Kind regards,
Tim

Co-Founder Transloadit
@tim_kos

Hi Tim,

We implemented our code according to the documentation that states:

${file.url_name} The name of the file, from which any characters other than A-Za-z0-9-_. are stripped, and with spaces replaced with dashes. This includes the file extension as well.
and

${file.url_basename} The basename of the file (the file name without the file extension), from which any characters other thanA-Za-z0-9-_. are stripped, and with spaces replaced with dashes.
But I picked up that you were in fact using underscores and changed our implementation.

We received a couple of IMPORT_FILE_ERROR’s today, again.
I’m looking into it at the moment as I’m not entirely convinced that the issue is not on our side.

Assemblies:
REDACTED
REDACTED
REDACTED

Nicolaas van der Westhuizen
[email blocked]

Hey Nicolaas,

right, I will updated the docs accordingly, stating that any non alphanumeric character will be replaced with an underscore.

The problem is that we cannot strip them. Some of our customers (like Chinese people) could not export any files to s3 if the filename was just “.mp3”.

Sorry for the inconvenience and the inaccuracy of the docs there.

Kind regards,
Tim

Co-Founder Transloadit
@tim_kos

I am going to close this ticket for now. Please feel free to reopen it again if you have further questions.

Kind regards,
Tim

Co-Founder Transloadit
@tim_kos