• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Coldfusion locking files when I upload then I can't delete

New Here ,
Jan 15, 2007 Jan 15, 2007

Copy link to clipboard

Copied

I have been having a problem deleting images for a while now. Everytime I upload a file with cffile I am unable to delete it for an unknown amount of time. I cant delete it with cffile delete or even delete it on the server manually. Its not a permissions issue because I can delete other files in the folder. Just the ones that were uploaded recently cannot be deleted or renamed. I ran the process explorer and it was telling me that jrun.exe had a handle on the picture names that were not able to be deleted. Is there a way to tell jrun.exe to relese the photo before deletion?

Process Explorer Window

Process PID Type Handle or DLL
jrun.exe 111580 Handle C:\Inetpub\www\website\photo i can not delete.jpg
TOPICS
Advanced techniques

Views

371

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 16, 2007 Jan 16, 2007

Copy link to clipboard

Copied

LATEST
Since you mentioned JPEG, are you displaying the image just after the upload? In that case, it's the HTTP server (Apache, IIS, etc.) that's probably locking your file for a while. I don't know if there's really a way to overcome this.

What I would do (in a Content management system, for example), would be a specific file-task queue, which stores a record in the database if the file deletion didn't work (use try-catch), and then run a specific page once in a while (cfschedule) which tries to delete the files that are waiting for their doom.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation