Warning: unlink(C:\Users\john\AppData\Local\Temp\phpE862.tmp) [function.unlink]: Permission denied in plupload_handle_uploads() (line 344 of ...\plupload\plupload.module) appears when I try to upload files in a Media Gallery.

When I upload 1 file, error appears 3 times; with 2 files, error appears 6 times.
Files might be uploaded, but are not attached to the Gallery. source, tmp, target and DAMP are all local.
i use module from 31-3-2011 and plupload library 1.4.2

Files: 
CommentFileSizeAuthor
#6 add-fclose-1121070-6.patch749 bytesMoloc

Comments

Status:Postponed (maintainer needs more info)» Active

(Almost) the same issue here.

Varsions:
plupload v 1.4.3.2
plupload module v. 7.x-1.0-beta2

I get a message for every file i upload.

I monitored my tmp folder and I noticed that when I start uploading a file, the temporaru file phpXXX.tmp is created. Upon success on uploading, the file phpXXX.tmp is replaced by something like p15utbbubj1t8eg69b5elv91i1d3.tmp

When I save my node the p15utbbubj1t8eg69b5elv91i1d3.tmp file is removed. But, somehow, the module must still try to access and unlink the original phpXXX.tmp file which is, obviously, not there anylonger.

I hope this helps fixing the bug.

EDIT:
system info:
- WinXP pro
- Apache/2.2.17 (Win32) PHP/5.3.6
- I can reproduce with IE8, FF (latest version to date), Chrome (latest version to date)

Status:Active» Postponed (maintainer needs more info)

Anyone else seeing this? I just tried it on Windows 7 Home Premium with Acquia Dev Desktop for Windows, and adding to the Media Gallery works fine on my end. If you're able to reproduce, please report the version of your OS and AMP stack, and also which browser (and version), and whether or not you have the Flash player installed in that browser.

Re #1: you're referring to saving a node rather than uploading to the Media Gallery. What module are you using for integrating plupload with nodes?

Status:Active» Postponed (maintainer needs more info)

I don't know if you noticed, but I edited my previous message with the info you required.
Please let me know if you need further info.

Thanks in advance.
A.

Same issue here. Win 7, Wamp 2.1 (Apache 2.2.17 / PHP 5.3.5), Firefox 3.6.18

It seems, that the input stream is not closed. Closing the input stream solves the problem for me.
Adding

fclose($in);

in plupload.module after the while-loop
line ~ 336 and line ~ 364

Status:Postponed (maintainer needs more info)» Needs review
StatusFileSize
new749 bytes

I tried to create a patch based on comment #5.

#6 patch got rid of the error for me. Thanks for that.

Wondering: should drupal_unlink() be used instead of PHP's unlink()? The doc states that "PHP's unlink() is broken on Windows, as it can fail to remove a file when it has a read-only flag set.".

Status:Needs review» Reviewed & tested by the community

Thanks for the patch, the error goes away.

@ #7 : Indeed the drupal_unlink() should be used instead of the PHP unlink().

I suppose that this should go into a different issue if a patch is not introduced in this one.

Status:Reviewed & tested by the community» Fixed

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 32b2c11 on 7.x-1.x, 7.x-2.x, 8.x-1.x authored by Moloc, committed by slashrsm: Issue #1121070 by Moloc: Warning: unlink(...) [function.unlink]:...