Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43293
Total Topics: 7522
Most Online Today: 118
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 98
Total: 98

Author Topic: Cannot Upload files to our downloads area  (Read 10086 times)

0 Members and 1 Guest are viewing this topic.

Offline zunnie

  • Member
  • *
  • Posts: 15
  • Black holes are where God divided by zero.
    • View Profile
    • AllNoobs
Cannot Upload files to our downloads area
« on: May 25, 2015, 10:07:37 am »
"The file may exceed the webserver upload limit please contact an administrator" is what i get all the time.
The file is a small C&C 3 map in a zip and small jpg screenshot.

Any idea what could be causing this? When i click back it says that the "temp folder seems to be not valid".
Would that be related? Is it something i can fix or do i have to contact the webhost?

I am using 4.1.3 with SMF 2.0.10

Thanks :)
« Last Edit: May 25, 2015, 10:23:08 am by zunnie »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: Cannot Upload files to our downloads area
« Reply #1 on: May 25, 2015, 10:49:22 am »
Would probably mean your upload directory/temp directory is not set correctly in php
Check the php.ini and see if it is set to the right spot and the webserver has permission.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline zunnie

  • Member
  • *
  • Posts: 15
  • Black holes are where God divided by zero.
    • View Profile
    • AllNoobs
Re: Cannot Upload files to our downloads area
« Reply #2 on: June 08, 2015, 08:04:44 am »
I solved it by changing the php version in cpanel.

However now i have a new problem:
When i upload files it tells me i have to enter a title. Which i obviously did do.

I am talking about a 68MB zip file and some JPG screenshots. They appear to upload fine but then in the end i get that error.
Any idea how this can be fixed?

Edit: Small files <1MB zip upload fine without said error.
« Last Edit: June 08, 2015, 08:06:31 am by zunnie »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: Cannot Upload files to our downloads area
« Reply #3 on: June 08, 2015, 08:52:08 am »
Check out this topic on increasing php limits
http://www.smfhacks.com/index.php/topic,3498.0.html
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline zunnie

  • Member
  • *
  • Posts: 15
  • Black holes are where God divided by zero.
    • View Profile
    • AllNoobs
Re: Cannot Upload files to our downloads area
« Reply #4 on: June 08, 2015, 10:56:22 am »
The Limit is set to 1GB already. But i will check again.
« Last Edit: June 08, 2015, 10:59:33 am by zunnie »

Offline zunnie

  • Member
  • *
  • Posts: 15
  • Black holes are where God divided by zero.
    • View Profile
    • AllNoobs
Re: Cannot Upload files to our downloads area
« Reply #5 on: June 12, 2015, 06:23:18 pm »
Ok the POST MAX SIZE was set too low ;) That is now fixed.

Now i have another problem:
When i click to download a file of rougly 50MB it takes a century (30s+) for the download-dialog to popup and initiate.
Do you have any idea what could be causing this significant delay between pressing download and actually starting to download the file?

http://www.play247.eu/index.php?action=downloads;cat=30
Try download any of the maps here, you'll notice a big delay. (Unless the file had just been downloaded)

Offline zunnie

  • Member
  • *
  • Posts: 15
  • Black holes are where God divided by zero.
    • View Profile
    • AllNoobs
Re: Cannot Upload files to our downloads area
« Reply #6 on: June 18, 2015, 10:01:59 pm »
So yea, big files 100MB and up take a really long time to initiate, any idea how to fix this?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: Cannot Upload files to our downloads area
« Reply #7 on: June 18, 2015, 10:42:27 pm »
In Sources/Downloads2.php
In function Downloads_DownloadFile()

Try changing
Code: [Select]
// Since we don't do output compression for files this large...
if (filesize($filename) > 4194304)
{
// Forcibly end any output buffering going on.
if (function_exists('ob_get_level'))
{
while (@ob_get_level() > 0)
@ob_end_clean();
}
else
{
@ob_end_clean();
@ob_end_clean();
@ob_end_clean();
}

$fp = fopen($filename, 'rb');
while (!feof($fp))
{
if (isset($callback))
echo $callback(fread($fp, 8192));
else
echo fread($fp, 8192);
flush();
}
fclose($fp);
}
// On some of the less-bright hosts, readfile() is disabled.  It's just a faster, more byte safe, version of what's in the if.
elseif (isset($callback) || @readfile($filename) == null)
echo isset($callback) ? $callback(file_get_contents($filename)) : file_get_contents($filename);
To
Code: [Select]
echo file_get_contents($filename);
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline zunnie

  • Member
  • *
  • Posts: 15
  • Black holes are where God divided by zero.
    • View Profile
    • AllNoobs
Re: Cannot Upload files to our downloads area
« Reply #8 on: June 19, 2015, 02:59:51 am »
Thanks for the suggestion, i made those changes but i don't notice any difference in downloads behavior :'(
Is there anything else i need to do for those changes to take effect? Clear cache maybe or so?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: Cannot Upload files to our downloads area
« Reply #9 on: June 19, 2015, 08:48:53 am »
Nothing else I can think of :( Other than getting faster disks on your hosting
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline zunnie

  • Member
  • *
  • Posts: 15
  • Black holes are where God divided by zero.
    • View Profile
    • AllNoobs
Re: Cannot Upload files to our downloads area
« Reply #10 on: June 20, 2015, 03:39:04 am »
It's not to do with the speed of the disk.
It's the way downloads are 'prepared for download' that is slowing it down significantly :'(
If i download a large file from my personal subdomain for example, a direct link, it initiates immediately after clicking the link.

Is there really nothing you can do about this? I have a dozen (and growing) big downloads on the website for games and people aren't gonna wait 30 seconds or more to download them, they'll think the link is broken and go away :/

Thanks for your help.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: Cannot Upload files to our downloads area
« Reply #11 on: June 20, 2015, 08:32:38 am »
Well a direct link fetches it from the server. While we are echoing it back.
You could try to add after
Code: [Select]
$real_filename = $row['orginalfilename'];
$filename = $modSettings['down_path'] . $row['filename'];

Add
Code: [Select]
header('Content-Disposition: attachment; filename="' . $real_filename . '"');
header("Location: $modSettings['down_url'] . $row['filename']);
obExit(false);

exit;

Not sure if this will work though and also now exposes the internal filename
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline zunnie

  • Member
  • *
  • Posts: 15
  • Black holes are where God divided by zero.
    • View Profile
    • AllNoobs
Re: Cannot Upload files to our downloads area
« Reply #12 on: June 21, 2015, 04:15:22 am »
That did not work either. I guess this download system doesn't work with big downloads :'(

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: Cannot Upload files to our downloads area
« Reply #13 on: June 21, 2015, 09:55:34 am »
Odd the second option just redirects to the file itself it should be the same as clicking a normal file.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline zunnie

  • Member
  • *
  • Posts: 15
  • Black holes are where God divided by zero.
    • View Profile
    • AllNoobs
Re: Cannot Upload files to our downloads area
« Reply #14 on: June 21, 2015, 04:37:46 pm »
Hm, maybe i did something wrong then. The page turned white when i applied your fix. So i had to remove that code from the file again.
Perhaps i inserted it in the wrong position?

 

Related Topics

  Subject / Started by Replies Last post
5 Replies
4440 Views
Last post March 13, 2007, 01:06:42 am
by STC007
2 Replies
6717 Views
Last post December 20, 2008, 08:05:34 pm
by jstop
2 Replies
4506 Views
Last post June 21, 2009, 10:39:39 am
by Paddleducks Forum - Damien
8 Replies
7163 Views
Last post January 11, 2015, 10:33:54 pm
by SMFHacks
6 Replies
1366 Views
Last post September 02, 2021, 07:35:00 am
by SMFHacks

+- Recent Topics

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

Powered by EzPortal