/    Sign up×
Community /Pin to ProfileBookmark

get "value" of file upload field

[FONT=”Tahoma”]I have a file upload field in my update form.

How do I get the value of what was put in the field (the file path), so that it can be re-inserted into the file field via php?[/FONT]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@meroauthorJun 16.2011 — i used this code at insert form





[code=php]$rfile = basename( $_FILES['file']['name']) ;
$target_path = "files/";
$target_path = $target_path . basename( $_FILES['file']['name']);
if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) {
echo "upload success";}
else{
echo "error";} [/code]



How to be in update form
Copy linkTweet thisAlerts:
@svidgenJun 16.2011 — You can't preset the client's source path. What you CAN do, if the file has already been uploaded, is replace the file input with placeholder text to indicate that the file was uploaded on the previous form submission.
×

Success!

Help @mero 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,
)...