Jump to content

Source image file being deleted before it can be displayed


Jimity

Recommended Posts

Hi All,

 

This is related to a previous post I have made in that its got to do with the same solution.

 

I have an HTML form with a PHP backend. The form takes in user data, and the PHP takes that data as variables and populates a series of source HTML files etc (which includes the same image files universally) where placeholder variables are located. These source files are copied from a source template location in order to keep things simple. Essentially its so I can create a customised HTML solution (with embedded images) for each specific end-user. 

 

On a Windows Browser client the customised solution and its source files are placed in an archive and pushed to the end-user as a download for them to then process locally on the Windows client. At the end of the download, all the customised source files, and the archive, are deleted. Thsi works 100% as intended. I also need to take into account non-Windows clients though. On clients such as iOS/MacOS/Android I currently have the customised HTML solution displaying to the end user directly in the browser (its a stepping stone towards a better solution later down the road). I then complete some cleanup work to remove the customised source files (which have been copied from a source template location as well). 

 

The problem I am having is.: The HTML file displays within the browser as intended. Unfortunately though the embedded image within this HTML file is not displaying. I've worked out its essentially because the HTML file and its source files (which includes the embedded image file) are being deleted as part of my cleanup work at the end of my PHP. Whilst the HTML file displays on the end users browser in time before this cleanup work, the image file is being deleted before the browser essentially receives it to be displayed, creating an empty box on the HTML where the image should be. Can anyone help me with some coding that could essentially delay the start of my cleanup work in the script until the HTML file and its embedded image have been loaded on the end-users' browser ? I've tried sleep() commands, flush() commands, and ob_flush() commands without any success.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.