473,378 Members | 1,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Upload image or file

64
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 1834

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

Similar topics

4
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
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
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
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
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
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
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
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
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
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.