/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Uploading Problems . . .

I’ve got a PHP script that I learned how to make largely from reading online “How-To” manuals . . . well, it’s not working, and everything LOOKS okay, I’m hoping someone who actually KNOWS what they’re doing can help.

[code=php]<?php

$target = “./”;

$target = $target . basename( $_FILES[‘uploaded’][‘name’]) ;

$ok=1;

//This is our size condition

if ($uploaded_size > 262144000)

{

echo “Your file MUST be smaller than 250MB’s.<br />”;

$ok=0;

}

//This is our limit file type condition

if ($uploaded_type != “application/pdf” || “audio/mpeg” || “audio/x-mpegurl” || “audio/x-wav” || “image/bmp” || “image/gif” || “image/jpeg” || “image/tiff” || “video/mpeg” || “video/quicktime” || “video/x-la-asf” || “video/x-la-asf” || “video/x-ms-asf” || “video/x-msvideo”)

{

echo “YOUR FILE TYPE IS NOT ALLOWED<br />”;

$ok=0;

}

else

{

echo “YOUR FILE TYPE IS APPROVED<br />YOU WILL BE REDIRECTED IN 5 SECONDS”;

$ok=1;

}

//Here we check that $ok was not set to 0 by an error

if ($ok==0)

{

Echo “Sorry your file was not uploaded”;

}

//If everything is ok we try to upload it

else

{

if(move_uploaded_file($_FILES[‘uploaded’][‘tmp_name’], $target))

{

echo “The file “. basename( $_FILES[‘uploadedfile’][‘name’]). ” has been uploaded”;

}

else

{

echo “Sorry, there was a problem uploading your file.”;

}

}

?>[/code]

I’m wanting to add a progress bar, so they don’t think their browser has stalled out on really big files, and I’m trying to send a user back to the main page once the upload is finished.

All these things are happening on [ [url]http://casey.wickedsmaat.com[/url] ]?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@SyCoDec 02.2008 — If you solved the issue yourself can you edit your post to provide the solution for anyone finding this thread.
×

Success!

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