answersLogoWhite

0

How do you upload an image using PHP?

Updated: 8/17/2019
User Avatar

Wiki User

9y ago

Best Answer

You upload the image in HTML using a form that includes the following field

<input type="file" name="fileUpload" />

After the form is submitted, you can access it with the $_POST variable as

$_POST['fileUpload']

http://www.tutorialsscripts.com/free-php-scripts/file-and-directory-script/image-upload.php

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you upload an image using PHP?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you upload an image to MySQL using PHP?

You cant upload an actual picture to MySQL, you can upload the URL but not the picture itself. You would have to upload this to your site first and then send the link to MySQL


How do you perform image slideshow in php?

Image Slideshow is very difficult using php. Instead store the image files in an image folder and apply slideshow to them using javascript. Here's a reference to automatic slideshow using javascript: How_do_you_create_slide_show_using_javascript_code


Why php not able to fetch the image from 'My Picture' in win XP to Script and diplay it?

PHP is a server-side language, and doesn't have access to your hard-drive. You have to get the user to upload the picture to the server, first.


Imageuploading in PHP using OOP?

It is possible to have an image upload object. You will simply create a class that takes the parameters required for an upload and pass it the upload resource given by the relevant $_FILES[''] superglobal. For instance one could use code like the following when calling this class: // Give the constructer the directory $uploader = new Upload("../galleryimages"); into which to upload. // The rest of the params. $notice = $uploader-&gt;uploadimage($_FILES['fileupload'], UPLOAD_TYPE_IMAGES, 220, 188, UPLOAD_KEEP_ASPECT);


What is php image size?

PHP can create images of different sizes. It depends on a particular image.


How do you get PHP codes for writing on an image?

You can use the GD extension for PHP to edit image files.


How do you install PHP scripts?

You need to upload the scripts to web hosting space that support PHP.


Upload image in jquery using aspnet?

http://www.mikesdotnetting.com/Article/95/Upload-and-Crop-Images-with-jQuery-JCrop-and-ASP.NET


How do you make a document in PHP about image manipulation?

I have had a lot of experience with image modification modules with PHP. In order to perform image manipulation in PHP you need an image processing module installed such as GD2 or imagemagik. GD2 comes with PHP and can be installed fairly easily if it is not already installed. You can follow the PHP GD manually for the usage of these functions.


How do you upload photos into blog?

If you're using blogger.com, there's a function for you to upload your photos directly into blogger. If not, you can also choose to upload your pictures onto an image hosting site and after that you'll just have to paste the HTML code into your blog. Some image hosting sites includes image shack, photo bucket etc. You can just create an account and upload your image onto the site and after that, you can share them online.


How do you save image url in database by using php?

If you can get the image url then just assign it to a php variable say: $image = (See related Link) Then you just have to add '$image' to the insert statement of your sql query Note: It would be better to store the folder path where your image is stored. That way your image will not be lost if your site moves to another server.


Can you sen a code to upload photo in javascript or php?

Please go to www.google.com, and search for "php upload photo script" or something alike. I'm sure you'll find somthing there.