Php url uploader error

Started on the old forum in November 2011 · view the original in the archive · old links redirect here

5 replies · 426 views · started 15 years ago · 1 min read

4 participants
bestman Junior · 32 posts #1

Hi, good day my fellow programmers, i need help in making a url file uploader

in normal uploader, we use $_POST[file];

to get the uploaded file size.

So i want to know what i will use to get the file size in a url uploader, I tried $file=("$_Post[file]"); $size= filesize('$file');

but it did not work

ogah Junior · 17 posts #2

$file = $_POST['file']; $size = filesize($file);

bestman Junior · 32 posts #3

I have done it and it did not work the file was uploaded but the size was not stored

arnage Lead · 811 posts #4

U need to use $_FILES global for form method file upload, not $_POST. See this for details: file-upload.post-method

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
something else Fellow · 2,296 posts #5
function remote_filesize($url)
{
ob_start();
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 1);
$ok = curl_exec($ch);
curl_close($ch);
$head = ob_get_contents();
ob_end_clean();
$regex = '/Content-Length:\s([0-9].+?)\s/';
$count = preg_match($regex, $head, $matches);
return isset($matches[1]) ? $matches[1] : "unknown";
}
bestman Junior · 32 posts #6

Thanks for ur effort but did not work

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close