Unable to open folder/file

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Unable to open folder/file

Postby llsastre » 10. November 2008 11:40

I'm trying this script http://www.buayacorp.com/archivos/guard ... -de-mysql/ and I need to have 777 permissions on a folder, but I'm unable to get it.
I'm working with windows vista and XP. I make a new folder (for example D:\tmp) and click with right button and then, in security tab, aply a total control to all users, but this script always tells the same error message: "Unable to open D:/Temp: Permission denied ..."
What must I do to change permissions?
Thanks.
llsastre
 
Posts: 11
Joined: 18. November 2005 13:47

Re: Unable to open folder/file

Postby Sharley » 10. November 2008 12:13

llsastre wrote:...I need to have 777 permissions on a folder, but I'm unable to get it.
Permissions 777 is for a 'nix OS not for Windows.

llsastre wrote:I make a new folder (for example D:\tmp)...but this script always tells the same error message: "Unable to open D:/Temp: Permission denied ..."

You could try creating the Temp folder in the same folder as your script in the .\xampp\htdocs\ folder as without setting the correct permissions for a folder outside the htdocs (the DocumenRoot) in the httpd.conf file then your script won't be able to write to it.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

No write permissions

Postby llsastre » 10. November 2008 13:14

I've tried it as you say but doesn't work either. It says "Unable to open 'tmp/' for writing: No such file or directory in C:\xampp\htdocs\web\grava_compr.php on line 87"
This folder 'tmp' is in 'web' folder and I've applied write permissions to all, but it doens't work.
I don't know what more can I do.
llsastre
 
Posts: 11
Joined: 18. November 2005 13:47

Re: No write permissions

Postby Sharley » 10. November 2008 22:05

llsastre wrote:I've tried it as you say but doesn't work either. It says "Unable to open 'tmp/' for writing: No such file or directory in C:\xampp\htdocs\web\grava_compr.php on line 87"
This folder 'tmp' is in 'web' folder and I've applied write permissions to all, but it doens't work.
I don't know what more can I do.

Paste here the relevant part of the script you have changed.

You can try this:
Create your temp folder in
C:\xampp\htdocs\web
So the path is:
C:\xampp\htdocs\web\temp

In your script where it asks for the path to the Temp folder type the above path like this:
"C:/xampp/htdocs/web/temp/thumbtemp"



I have had a look at the script you are trying to install and perhaps the relevant part you have to change looks like this:
Code: Select all
# Nombre del archivo temporal del thumbnail
define("NAMETHUMB", "/tmp/thumbtemp"); //Esto en servidores Linux, en Windows podría ser:
// define("NAMETHUMB", "c:/windows/temp/thumbtemp"); y te olvidas de los problemas de permisos

The comments roughly translated:
Code: Select all
# Name of the temporary file of the thumbnail
define("NAMETHUMB","/tmp/thumbtemp"); //This for Linux servers, in Windows it could be:

// define("NAMETHUMB","c:/windows/temp/thumbtemp"); You forget the problems of permissions

So if you create the temp folder in the above suggested path then this is what the NAMETHUMB entry could look like.
Code: Select all
define("NAMETHUMB","C:/xampp/htdocs/web/temp/thumbtemp");

...and as the comment tells you "Forget changing the permissions to (777) on Windows". The permissions required are usually already in place.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Postby llsastre » 11. November 2008 08:43

I know 777 permissions is only for unix/linux OS. I've writed so only to say that I need write permissions on this folder. In windows XP and vista must change the properties-security folder permissions for every user on it.
I've tried all your advices, but they don't work. Finally, with a bit of luck, I've tried this (Previously I've changed permission to total control to all users to this folder "C:/xampp/tmp/"):
...
$urltmp="C:/xampp/tmp/";
switch($type) {
case $mimetypes[0]:
case $mimetypes[1]:
$img = imagecreatefromjpeg($tmp_name);
$urltmp=$urltmp."imatge.jpg";
break;
case $mimetypes[2]:
$img = imagecreatefromgif($tmp_name);
$urltmp=$urltmp."imatge.gif";
break;
case $mimetypes[3]:
$img = imagecreatefrompng($tmp_name);
$urltmp=$urltmp."imatge.png";
break;
}
define("NAMETHUMB", $urltmp); //y te olvidas de los problemas de permisos
...
and now it works fine.
I think I had given permissions correctly to the folder, but the original script doesn't find the file to read/write on it. Now, I add a name to this image file "imatge.xxx" and it can read/write/erase the file.
It's a little bit strange because on a linux server the original script works fine as is.

Thanks a lot for your help. It has helped me to think with other possible (or impossible) solutions.
llsastre
 
Posts: 11
Joined: 18. November 2005 13:47

Re: Unable to open folder/file

Postby axiom » 17. February 2012 01:03

I hope this helps those that have been struggling with this for a while.
http://www.howyoudo.info/index.php/how-to-fix-windows-server-upload-file-inherit-permissions-error/
Why can't windows just use the simple Unix style permission system rather than all this bs.
axiom
 
Posts: 1
Joined: 17. February 2012 01:00
Operating System: windows

Re: Unable to open folder/file

Postby JonB » 17. February 2012 01:52

Bill Gates thought it up to aggravate you.

:lol:
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 144 guests