Mobile app's resource file with a non-standard extension


I am using a Personal environment.

When my mobile app has a resource file with a non-standard extension and a property 'Deployed to Target Directory', the mobile app probably fails to start.

The error log in service center were as following:

    Upgrade failed - rolling back to previous application version.
    Failed to load resource '/aa/test.traineddata?DMF1ucDxtqgxw5niaXcmYQ' with status: Not Found

To reproduce:

  1. Create new mobile app with Phone template and create a new module.
  2. In data tab, import a file as resource and set its name to 'test.traineddata'.
  3. Set a 'Deploy Action' property of the resource file to 'Deploy to Target Directory'.
  4. 1-Click publish.  The publish may succeed.
  5. Click 'Open in Browser'.  This attempt proberbly fails and succeeds rarely. Using 'OutSystems Now' mobile app, you probably meet the same trouble.

Does someone know how to avoid the trouble?

I noticed that the error doesn't happen when the resource file with a standard extension like '.txt'.
But I want to use a file with non-standard extension in my server action.


Not completely sure... but my tests show that the issue is with you renaming the file... after you've imported it.

As a test I "named" a file, after import, to apple.123 and the app failed to update.

My tests do show that there is no issue when you start with a filename of test.traineddata.  If you import a file... and the actual file is named test.traineddata... then there is no reason to "rename" it... and the app render / update will not fail.

Hello Davidk,

Thank you for spending your time for my problem.

On my environment, I still met the same error when importing a file named 'test.traineddata' from the beginning.
Without setting the deploy action, no error occurred.  But I need the deploy action.

I am confusing...


My apologies Takasi... I was wrong about the import.  I'd tried a number of files... but then forgot to turn Deploy to Target Directory back on.  I tried apple.traineddata, apple.train, apple.trn, and apple.htm.  Only apply.htm did not cause the issue.

So... I would conclude that OS is only allowing known filetypes.  I would report this and see if there is a reason.

I've tested the following:

apple.htm - no issue

apple.jpg - no issue

apple.png - no issue

apple.eps - no issue

apple.hqx - a mac file extension - no issue

apple.class - a valid extension - failed

apple.mtb - a MiniTab extension - failed

apple.html - no issue

Thank you for your reconfirming, Davidk.
I agree your conclusion. If my non-standard extension was appended to the MIME settings of IIS, the trouble might disappear.

In mobile application, resource files must be available for client actions.  Activated mobile app checks this availability.  But if its extension was not appended to MIME settings of IIS, IIS would report the error of not found on the checking.  Unfortunately, I have no way to append it to MIME settings of IIS on Personal environment.

For my case, I want to these resource files only for server side action.
If there was a flag for 'only for server action' and omitted the check of client availability, I would be very happy.

As a workaround for my current case, I found the following method.

  1. Set Deploy Action of the resource file with non-standard extension to 'Do Nothing'.
  2. Use 'Path_GetApplicationDirectory() + "\bin2\hidden_resources\" + <file_name>' to handle the file path from server action.

The method disallows using sub-directory.


That's excellent sleuthing.  Thanks for the detailed update.  Are you going to check with OutSystems?

I just posted my opinion of the 'only for server action' flag to Idea site instead of checking with OutSystems. If my thinking was incorrect, they might comment to the post.

Thank you for discussing.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.