473,487 Members | 2,452 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem with uploading image

118 New Member
Hi,

i wrote a code to upload a image.In my local it works fine. When i place this code in website through FTP. In that it will not works.
i am giving the upload path ../upload . When i try to give the chmod permissions in FTP through fileattributes propery to upload folder it will give the message as

Status: Set permissions of '/admin/upload' to '777'
Command: SITE CHMOD 777 upload
Response: 500 'SITE CHMOD 777 upload': command not understood

code :

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Untitled Document</title>
  6. </head>
  7.  
  8. <body>
  9. <form name="Form1" method="post" action="test_add_act.php" enctype="multipart/form-data">
  10. <input type="hidden" name="chk[]" value="">
  11. Image<input type="file" name="upload" />
  12. <br /><input type="submit" name="submit" value="Submit" />
  13. </form>
  14. </body>
  15. </html>
  16.  
  17.  
test_add_act.php

Expand|Select|Wrap|Line Numbers
  1. <?
  2. $filen=$_FILES['upload']['name'];
  3. $path = '../upload/'.$filen; //generate the destination path
  4. $imagepath='upload/'.$filen;
  5. move_uploaded_file($_FILES["upload"]['tmp_name'],$path);
  6. ?>
  7.  
i am getting this error

Warning: move_uploaded_file(../upload/admin_02.gif) [function.move-uploaded-file]: failed to open stream: Permission denied in C:\Inetpub\vhosts\bodypost.com\httpdocs\admin\test _add_act.php on line 14

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\Temp\php21.tmp' to '../upload/admin_02.gif' in C:\Inetpub\vhosts\bodypost.com\httpdocs\admin\test _add_act.php on line 14


Anybody Could please tell the solution how can i resolved my problem?
Mar 26 '09 #1
2 1609
shanmugamit
45 New Member
Hi swethak ,

check ur folder have all rights that is read,write and execute.
Mar 26 '09 #2
Dormilich
8,658 Recognized Expert Moderator Expert
@swethak
it seems like your server didn't understand your chmod command and thus didn't set the permissions you wanted. the response looks like an "internal server error".
Mar 26 '09 #3

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

Similar topics

6
4452
by: Ralph Freshour | last post by:
I'm trying to code the ability for my users to upload up to photo's to mysql database - can someone point me in the right direction as to how this might be done in php? Perhaps a tutorial or some...
5
17464
by: ok | last post by:
Hello, Q: How do I get image width and height before uploading an image? This because, I want to restrict people uploading huge files. Thanks in advance
7
3977
by: lion | last post by:
I get these errors when uploading images via a web page: (the page still uploads the images but reports these errors?) Warning: fopen(D:\php\uploadtemp\php1FC7.tmp) : failed to create stream: No...
3
3042
by: Pitcairnia | last post by:
The basic purpose of the site is for authenticated users to post event listings, which often include photographs. The user is faced with a page where they can insert all of the information about...
4
2140
by: Himanshu | last post by:
hi, Can anybody tell me that thru asp.net using c#, how can we upload and download physical files in any table of SQL Server Database. the uploading part is running successfully but the...
4
1630
by: Ramakrishnan Nagarajan | last post by:
Hi, I am facing a different problem in my application. In that I am uploading a folder that contain only images. Everything was done and was working fine too. When I executed the application using...
2
5914
by: prakharv | last post by:
Hi All, Below is the code which I am using to upload a jpeg file to the server. But the problem I am facing is that it is not copying the entire contents of the image file to the webserver and it...
7
4496
by: dasrasmikant | last post by:
Dear Experts, I am falling in a trouble and need your help for solving it I want to get the width and heignt of an image before uploading it. Below is my code <script language="javascript">...
2
2041
kamill
by: kamill | last post by:
Dear All, I am uploading a image file and after resize the image i am saving it. My script is working fine with small size images but when i am trying to upload big size image, i am getting below...
1
2104
pezholio
by: pezholio | last post by:
Hi, It seems that every time I put together a new script to upload a file I always have problems, here's the latest one: I've got a form with two file input fields, when I submit the form,...
0
6967
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...
0
7137
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,...
0
7181
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...
0
7349
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5442
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,...
1
4874
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3076
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...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1381
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 ...

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.