473,509 Members | 2,828 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Upload image or file

64 New Member
Below is the code upload image...but I couldn't see the error..

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. if (isset($_POST['btn_uplaodpic']))
  3. {
  4.     $id = $_POST['hf_uname'];
  5.     move_uploaded_file($_FILES['file']['tmp_name'],"images/".$id.".jpg");
  6.     echo "Successfully upload!";
  7. }
  8. ?>
Is that the correct code for upload image?
Mar 30 '15 #1
0 1839

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

Similar topics

4
6256
by: Martin | last post by:
Hi, I search for free script to enable function UPLOAD Images, Files to Webserver, and save in a directory. I have tried a free script, but it doesn't work. (http://www.freeaspupload.net), when...
1
4307
by: Patsy | last post by:
Hi I'm using a third party software which captures image from a webcam and saves it to local harddisk. It also comes with a function to send the image file via HTTP encoded with...
15
5302
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
3
2000
by: wingleader | last post by:
Hi! Can someone help? I need to store image files in mysql database. Can you help with advice, how can it be done? I need a possibility to upload images, and that late it could be read as an image.
0
1981
by: aris1234 | last post by:
hello.. How to upload image file in page update ..?? i have logic like this : if user upload new image then old image must delete and update DB used new name if user not upload new image then...
3
4404
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine...
2
4420
by: sidhx | last post by:
how can i let image overwriting when uploading? and if uploading an image say "logo.jpg" and if a file already existing say "logo.png" then, how can i replace the file logo.png to logo.jpg(which has...
0
2001
by: sharmashrayansh | last post by:
I am trying to upload a picture from the Pictures Library (on WP7) and save it in a folder on the server. On the server, I'm using PHP to receive the file using POST Method. The PHP Code is:...
1
1252
by: assabu | last post by:
i want to upload images to the xml file and view in slide show but i can't any one who nows can help me
0
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
7073
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...
0
7506
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
5656
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,...
0
4732
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...
0
3218
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
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
443
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.