[HTML5] FHTML5PlatformFile does not work, cannot open/write/verify files exist

Dear Friends at Epic,

I am aware HTML5 is very much still in development, but I wanted to report these issues to make sure they get addressed :slight_smile:

I am unable to read/write/verify files exist using FHTML5PlatformFile, which amounts to using IPlatformFile::GetPlatformPhysical() when the compiled OS is HTML5.

I am testing using offline / localhost HTML5 builds, not yet deployed to server.

I’ve tried using as well as using fopen as well as using FHTML5PlatformFile, and I cannot open/read/verify files exist using any of these methods when compiling for HTML5.

Please note the code below is generic, and works perfectly in windows / development builds.

So please note the code below works great if not compiled for HTML5, but does not work at all for HTML5 builds.

A simple test is just to verify whether an existing file actually exists!

In windows the code below shows true in both calls.

In HTML5 false is returned by both calls, one of which is using FHTML5PlatformFile.

Is it a requirement that the HTML5 build be deployed to server before it will work?

I am using Google Chrome (32 bit)

:slight_smile:

//Implemented by HTML5 Platform
IPlatformFile& PF = IPlatformFile::GetPlatformPhysical();

//! WINDOWS SAYS YES, HTML5 SAYS NO, WHY?
//! PF is even using the HTML5 Physical Platform File!
//! FHTML5PlatformFile
VSCREENMSG2("File Exists", BOOLSTR(PF.FileExists(TEXT("c:\\Tests\\HTML.txt"))));
	   
//! WINDOWS SAYS YES, HTML5 SAYS NO, WHY?
FILE *fp = nullptr;  
fp=fopen("c:\\Tests\\HTML.txt", "r"); 
VSCREENMSG2("C++ TEST File Exists", BOOLSTR(fp!=nullptr));

#Summary

The above two attempts to check if a file exists, using a hardcoded path, both work great and return true in editor builds, but both return false in HTML5 builds.

I dont understand why FHTML5PlatformFile is not working, my questions

  • are all HTML5 file paths relative to some other directory?
  • does the HTML5 build have to be actually deployed to server to work correctly?
  • has the FHTML5PlatformFile been tested as working, if so what is proper usage if above two questions are not relevant?

Thanks!

#:heart:

Rama

Hello Rama,

It is recommended that you use a 64bit browser when working with HTML5, so I suggest giving that a try as well.

As far as your issue goes, I’m having a bit of trouble understanding exactly what it is you are trying to accomplish, and what the error you are seeing is. I see that you say it is working on a Windows build, but not working on an HTML build. Could you provide more details as far as what it is that you’d like to do?

Thank you.

Hello,

I am marking this post as resolved for tracking purposes, as we have not heard from you in a few days. If this issue persists, feel free to respond to this thread. For any new issues, please create a new Answerhub topic.

Have a great day