[SOLVED] Upload file
Moderator: General Moderators
[SOLVED] Upload file
Hi guys.. In my PHP web-based system, I want to do one part that can upload file into the folder. For example, in this system, there are one page to register user. In this page I can enter all user profiles. Then I can upload user's photo and I want to save/upload this photo into one folder called 'photo'. I run this system on my server using Centos as my Operating System. The problem now is I don't know the code to upload file into the folder. Anybody can help me please?
Last edited by S_henry on Fri Mar 30, 2007 2:18 am, edited 1 time in total.
-
impulse()
- Forum Regular
- Posts: 748
- Joined: Wed Aug 09, 2006 8:36 am
- Location: Staffordshire, UK
- Contact:
Use a HTML upload form and then you'll need to look into http://uk.php.net/manual/en/function.mo ... d-file.php
Now I can upload file into the folder. But its only work on Windows. When I put the system into the Centos server, it won't work. I can use two functions for this and both work on Windows. These are the funtions:
Anybody have any idea on this please?
Code: Select all
move_uploaded_file($filename,$uploadpath."/".$filename_name);
//or
copy($filename,$uploadpath."/".$filename_name);you must chmod() the destination folder to give it the correct permissions
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.