/    Sign up×
Community /Pin to ProfileBookmark

How to retrive uploaded files using php

Hello Php Gurus

I am still finding my way around php.

i need to retrieve a file uploaded to my server with its path linked to a database.I am seeing every other thing except for the file uploader by that user.please can someone show me how to put the code for the link on this file for a user to show on the html output?Thank you this is the array

@$upload_Name = $_FILES[‘FILE’][‘name’];
@$upload_Size = $_
FILES[‘FILE’][‘size’];
@$upload_Temp = $_FILES[‘FILE’][‘tmp_name’];
@$upload_Mime_Type = $_
FILES[‘FILE’][‘type’];

@move_uploaded_file( $upload_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload_URL = “uploads/”.$upload_Name ;
$id=$_POST[‘id’];
$name=$_
POST[‘name’];
$from=$_POST[‘from’];
$gender=$_
POST[‘gender’];
$address=$_POST[‘address’];
$upload_Name=($_
FILES[‘FILE’][‘name’]);
//Writes the information to the database
mysql_connect(“localhost”, “p_o”, “hello”) or die(mysql_error());
mysql_select_db(“p_profile”) or die(mysql_error());
mysql_query(“INSERT INTO `users_cv` VALUES (‘$id’, ‘$name’, ‘$from’, ‘$gender’, ‘$address’, ‘$upload_Name’)”);

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@NianticDec 21.2013 — I am seeing every other thing except for the file uploader by that user.[/QUOTE]
Is it the file-uploader (i.e username) or the file that was uploaded?
Copy linkTweet thisAlerts:
@speroxauthorDec 21.2013 — Hi

The file that was uploaded
Copy linkTweet thisAlerts:
@NianticDec 22.2013 — Everything works except the file isn't uploaded, is that correct?

To me it looks like something is missing, but you may have that somewhere in your code (unless this is all)

(I am also fairly green on this, I have only been working with PHP for a bit more than a year)

Is there a chance I can see the entire code for this submit form?
Copy linkTweet thisAlerts:
@NianticDec 22.2013 — This may be useful for you, a thread for image upload.

Should be easy to adjust to a file upload, or use it as reference ?
×

Success!

Help @sperox spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...