/    Sign up×
Community /Pin to ProfileBookmark

file uploading with PHP

I have looked at a lot of examples of this and have adopted the same approach and it works I can get a file uploaded to the server. I have checked that it uploads all the time. However the HTML application that contains this code…
<form name=’form’ action=”inc/uploadPlotData01.php” enctype=”multipart/form-data” method=”POST” >
<label class=’label’>Enter/Select File for Uploading:</label><br />
<input type=”hidden” name=”MAX_FILE_SIZE” value=”100000″ />
<input id=”file” class=’box’ type=”file” name=”file” value=”” size=”40″ title=’locate the file for uploading and plotting on map’/>
<input class=’butt’ type=”submit” value=”Upload” />
</form>

… transfers the control to the PHP application (uploadPlotData01.php) into another window instance and never returns. The user can of course use the ‘back’ button but that’s simply not on.

The server-side PHP code is as follows:
<?php
$uploaddir = ‘uploads/’;
$uploadfile = $uploaddir . basename($_FILES[‘file’][‘name’]);
move_uploaded_file($_
FILES[‘file’][‘tmp_name’], $uploadfile);
?>

This can be tested at…

[url]http://demo.cubewerx.com.au/NuMaps/test.html[/url]

There must be something I am missing here. Does anyone have a clue?

Cheers…

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@scragarNov 01.2007 — [code=php]header("location: http://demo.cubewerx.com.au/NuMaps/test.html");[/code]
Copy linkTweet thisAlerts:
@ezigoingauthorNov 01.2007 — Thanks this has helped me. However, this re submits the page again and loses all previous status. I want to keep everything the same, upload the file and then allow the user to do something as part of a sequential process.

Cheers,
Copy linkTweet thisAlerts:
@ezigoingauthorNov 01.2007 — Thanks this has helped me. However, this re-submits the original HTML app again and loses all previous status. I want to keep everything the same, upload the file and then allow the user to do something as part of a sequential process.

Cheers,
Copy linkTweet thisAlerts:
@scragarNov 01.2007 — you could try puting the form in an Iframe, or include the PHP code directly into your form page, this is about the only systems I can think of that will work.
×

Success!

Help @ezigoing 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...