Server deleting HTML file in htdocs (false malware alert?)

My website URL is: remitheriault.cf, but the file I’m trying to access (which gets deleted upon upload) is remitheriault.cf/blog_violin.html. This file (and others) have been working on my site for more than 2 weeks but then suddenly they got deleted and get immediately deleted again whenever I try to upload them.

What I’m seeing is: “Oops! That page can’t be found.” (because it can’t find the page)

I’m using this software: FTP client or web browser (cPanel File Manager) to upload files

Additional information:

I’ve of course read the relevant support page: https://infinityfree.net/support/why-are-my-files-deleted-after-uploading/

  1. The file is in the htdocs folder
  2. The file type is allowed (.html)
  3. The file does not contain malware (a tutorial I made in R myself). That same file is otherwise accessible (not deleted) in the media section of my WordPress at this url: https://remitheriault.cf/wp-content/uploads/2019/09/blog_violin.html
  4. The file is not bigger than 10 MB (it is 953 KB)
  5. The file is a HTML, but is no larger than 1 MB (it is 953 KB)

Is it possible the file is falsely identified as malware? Why would it work on the Media section of the WordPress though? I’m clearly missing an obvious detail. Thanks for helping! :slight_smile:

Hi, I’m reposting because though it’s been a week already I’m the only old answer with 0 reply! :sob:

I just checked again and I still have the same problem. Can anyone help me? :slight_smile:

However, I did a test with a smaller version of the same file and it seems like this one does not get deleted: http://remitheriault.cf/blog_test.html (914 KB). Might it be because 953 KB is evaluated as greater than 1 MB on the server?

It’s sad because I only have two such tutorials and they contain only figures. And why are they accepted in the media section of the WordPress site?

Thank you!

  1. What is the file name you’re uploading?
  2. Could you post the source code of the file you’re trying to upload, using a service such as https://pastebin.com/

EDIT: Actually, it might be because it still detects it as over the file size limit. Would you be able to minify the file, or seperate some portions into a seperate file (e.g. JS or CSS code)?

2 Likes

The upload limits are possibly implemented separately on the FTP server and the webserver, which may cause some rounding problems.

The reason why your file is so big is that there is Javascript file inlined on line 212. If you could somehow export that Javascript content to a separate file, is would drastically reduce your file size. And Javascript files can be up to 10 MB, instead of 1 MB.

5 Likes

Thanks guys! Thanks to you, I found out that R Markdown outputs unnecessarily large HTML files by default!

From the documentation:

The size of an HTML document created from an empty R Markdown document with the html_document format is about 600Kb, which is roughly the total size of all CSS, JavaScript, and font files in the default theme.

If you are concerned about the file size but still want a fancy theme, you may consider the prettydoc package (Qiu 2019), which has bundled a few pretty themes (yet small in size). This package provides an output format prettydoc::html_pretty . An empty R Markdown document with this format generates an HTML file of about 70Kb.

So basically, I was able to fix it by replacing this line in my code header:

output: html_document

With this (note: had to install the prettydoc package first):

output:
   prettydoc::html_pretty:
          theme: cayman

Doing this, my file size went from 953 KB to 205 KB, and now it works on the InfinityFree server! I’m glad to know the issue wasn’t my figures. It’s going to be easier sending html code/scripts by email now too! Thanks guys!

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.