Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0
This is the forum to discuss the Wrox book Beginning PHP5, Apache, and MySQL Web Development by Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass; ISBN: 9780764579660
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 18th, 2008, 10:56 PM
Authorized User
 
Join Date: Oct 2007
Location: Lucknow, UP, India.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 7: permission Denied while uploading files

Problem

move_uploaded_file(C:/wamp/www/vab/userpics) ::failed to open stream: Permission denied in C:\wamp\www\vab\app_code\Controller\uploads.php on line 11



I am using WAMP package 2.0 on windows Platform.
can Any one Suggest what should be the solution for this Problem?

Here are Few steps that I followed........
1. I uncheck the "use simple file sharing " checkbox under tools>>Folder options >> views.

2. then I gave full controll to my useraccount on my application located at C:\wamp\www\vab


Here is code that I written.......
Code:
if(move_uploaded_file($_FILES['file']['tmp_name'],$imgname))
        {
            $type=checkFile($imgname); //to check file type
            if($type==".gif" ||$type==".jpg" || $type==".png"){
                $user=new UserInfo();
                $user->setEmail($_SESSION['email']);

                $done=$photo->changePhoto($imgname, $user, $type, $dir); // to create & save url in database.

                    if($done){
                        $_SESSION['msg']="Profile Picture Changed....";
                        redirect_to("../../pages/freeHome.php");
                    }
                    else{
                            $_SESSION['msg']="An error Occured while uploading.<br> Please try later....";
                            redirect_to("../../pages/freeHome.php");
                        }
                }
                else             
                    echo "Please Choose a correct File type";                    
            }


Please help me in resolving this code.

Reply With Quote
  #2 (permalink)  
Old July 28th, 2008, 06:54 PM
Registered User
 
Join Date: Jul 2008
Location: Leeds, , United Kingdom.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

is the value of you $imgname property "C:/wamp/www/vab/userpics"?

If so, I think you have only put in the directory name without the filename - hence, it won't work!

Here is the code I use: -

// for main server $imagedir = "/home/thechari/public_html/images/photos/";
$imagedir = "c:/xampp/htdocs/tcbr/images/photos/";

$imagetempname = $_FILES['filename']['name'][$i];

if ($imagetempname != "")
{
    $imagename = $imagedir . $imagetempname;
    if (move_uploaded_file($_FILES['filename']['tmp_name'], $imagename))

etc...

Let me know if it works!

Reply With Quote
  #3 (permalink)  
Old July 28th, 2008, 06:55 PM
Registered User
 
Join Date: Jul 2008
Location: Leeds, , United Kingdom.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

whoops, made a mistake: -

$imagetempname = $_FILES['filename']['name'];


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(0x800A0046) Permission denied,not IIS permission! David Hay Classic ASP Basics 3 April 30th, 2006 10:47 PM
Permission denied zah_amir Classic ASP Databases 1 January 24th, 2006 11:45 PM
Permission denied tksarun Classic ASP Components 0 March 11th, 2005 03:01 AM
Permission Denied hamidmq Javascript How-To 2 March 10th, 2005 09:41 AM
Permission denied in acessing dll files sobhamuktha VB Components 6 February 4th, 2005 08:17 AM



All times are GMT -4. The time now is 03:43 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.