473,769 Members | 7,584 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

permission denied for upload

41 New Member
hi all

i am uploading an image on live linux hosting server and getting the below error

Expand|Select|Wrap|Line Numbers
  1. Warning: move_uploaded_file(../graphics/home_bigad2.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/gads/public_html/vineet/admin/add_special_offer.php on line 12
  2.  
  3. Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpXjKkp7' to '../graphics/home_bigad2.jpg' in /home/gads/public_html/vineet/admin/add_special_offer.php on line 12
  4.  
  5.  
This is my php code
Expand|Select|Wrap|Line Numbers
  1. <?php require_once("../config.php");
  2.  
  3. $msg="";
  4.  
  5. if(isset($_REQUEST['submit']))
  6. {
  7. $loc=$_REQUEST['offer_loc'];
  8. $path=$_FILES['offer_image']['name'];
  9. move_uploaded_file($_FILES['offer_image']['tmp_name'], "../graphics/" . $_FILES['offer_image']['name']);
  10.  
  11.  
  12. $qry="insert into special_offers(location,offer_image) values('$loc', '$path')";
  13.  
  14. if(mysql_query($qry))
  15. $msg="Offer Inserted successfully";
  16. else
  17. $msg="Error Inserting Offer";
  18. }
  19.  
  20. ?>
  21.  
vineet
Dec 18 '08 #1
6 1293
Markus
6,050 Recognized Expert Expert
Make sure the folder you're moving to file to has the correct permissions.
Dec 18 '08 #2
vinpkl
41 New Member
@Markus

hi markus

how do i set corect permission. can u say in detail

vineet
Dec 18 '08 #3
Markus
6,050 Recognized Expert Expert
@vinpkl
Do you use an FTP for your site files - if so, what FTP program, or are they stored locally on your computer?

If they're stored on your computer, you can right-click a folder or file, select properties, and then, from the security tab, change it's permissions. - This is for Windows.

My FTP allows me to do the same thing; right-click the folder/file I want to edit, then change the permissions from their.
Dec 18 '08 #4
vinpkl
41 New Member
@Markus

hi marcus

i m using ftp software.

tell me what to write in permission after right click properties. at present its 755

vineet
Dec 18 '08 #5
Markus
6,050 Recognized Expert Expert
@vinpkl
Try changing it to 766.
Dec 18 '08 #6
vinpkl
41 New Member
@Markus

hi markus

just a question in my mind that

will changing permission harm my server or website security in any way.

vineet
Dec 18 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

9
7157
by: bird | last post by:
What can cause the PHP code fopen("filename","a") to fail with permission denied message as below? ------------------ Warning: fopen(filename): failed to open stream: Permission denied in /home/lookout/u2/kmei/www/test1.php on line 14 ------------------ I write a short PHP code that works fine on my own apache server, but it doesn't work after I upload it to the university server. Note that 'chmod 777 filename' works as expected.
2
2598
by: Ivan Cheng | last post by:
I have a web server running Windows NT and IIS 4.0. My users that are using Windows 98 2nd edition have no problem uploading their files into the server via ASP but those users that are using Windows 2000 Professional will have the below error : Microsoft VBScript runtime error '800a0046' Permission Denied
2
16300
by: Brian | last post by:
Hi I am moving a site to a new server, I have been testing it and one of the pages uses move_uploaded_file, but I get a Permission denied. The directory I am moving it to is chomd of 755, if I change it to 777 it does upload but the owner is www-data, but I then can't download it using a FTP client (which I have to do) as it's the wrong owner, so I have to leave the chomd as 755, but
6
1531
by: Andy | last post by:
Hi I have created a facility to allow the user to upload an image file to the webserver. When the user creates the image for the first time i.e. the image does not exist within the directory everything works fine. The problem occurs if my ASP.NET dll tries to delete the file or overwrite it??? I assume my app will be using the ASPNET account and I
2
1720
by: Christoffer Sørensen | last post by:
Hi, I have a created a simple file upload asp.net web page which also creates directories on the fly using the following code: string fullpath = Server.MapPath(".\\..\\..\\" + path); DirectoryInfo dir = new DirectoryInfo(fullpath); if(!dir.Exists) dir.Create(); Now the dir.Create() statement gives me a permission denied. The ASP.NET user has been giving full control to the directory and in IIS Admin the directory has write...
0
880
by: a338029 | last post by:
Hi, My requirement is like we need to upload the files from our application. The upload should be through Application only and no one can access the folder using windows explorer. This is a dot net application upload functionality is using dot net control to upload the same and the project has been configured as "Integrated windows authentication" in IIS. Application and file storage server are two different server. When I have given...
1
1459
by: byrdman | last post by:
When I upload a image file to a folder on a my server in Fire Fox i get a request for username and password dialog box. If I cancel the dialog box for Fire Fox I get a permission denied error. The error shows me the path for the saveAs method and nothing is wrong with the path. When I use IE the file uploads just fine. No permission issues. Looking for solutions. Thanks
1
1841
wadro21
by: wadro21 | last post by:
i am trying to write a php uploader for a site and keep getting this error: Warning: move_uploaded_file(uploads61877494_tp.jpg) : failed to open stream: Permission denied in /home/mysite/public_html/login/upload.php on line 5 Warning: move_uploaded_file() : Unable to move '/tmp/phpKlOJBh' to 'uploads61877494_tp.jpg' in /home/mysite/public_html/login/upload.php on line 5 I can run it fine on my local machine but when i upload it to the...
6
62767
by: Andy2500 | last post by:
Hi, I'd like to upload an image to a folder, then I have 3 diffrents examples but all of them give an error "failed to open stream: Permission denied", althrough the C:\Inetpub\wwwroot is not protected. Any suggestions would be helpful, thank you for your time.
3
7727
by: unauthorized | last post by:
I'm running a PHP 5.1 on an Apache 2.2 server under Windows XP which I use to develop my web apps. Currently, I am trying to add "upload" functionality to my project, but for some reason, when the move_uploaded_file() function is called on it, the following error is generated: Now this error may appear to be simple write permission issue, but the account that is running the service has full r/w permissions to the directory that is supposed...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10048
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9996
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.