TinyPortal

Development => Support => Topic started by: Celtland on August 08, 2007, 12:50:24 AM

Title: File Uploads/Downloads are Empty
Post by: Celtland on August 08, 2007, 12:50:24 AM
I can't figure out why - but there are a few specific files that when we try to upload them - both as attachments on the forum and as downloads in TP, will upload fine, show up intact in the server, but when you download them they show up on your PC with a size of 0 bytes.  I have tried the downloads both in FF2 and IE7 with different security settings.  I've checked file/folder size limits both in SMF and TP and nothing has been exceeded.  I've made sure the folder permissions on the attachments and tp-downloads folders are set correctly.  The only problem files have been archives... I've tried zip, tar, and 7z files - all upload fine, but will not download.  I don't get any errors trying to download them as attachments from posts, but when I try from the TP downloads section, I get the following:

---modstothemax.net/community/index.php?action=tpmod;dl=adminitem313
2: filesize() [<a href='function.filesize'>function.filesize</a>]: stat failed for /***/***/public_html/community/tp-downloads/Building_Tut4.zip
File: /***/***/public_html/community/Sources/TPdlmanager.php
Line: 1586

and

---modstothemax.net/community/index.php?action=tpmod;dl=admin
2: filesize() [<a href='function.filesize'>function.filesize</a>]: stat failed for /***/***/public_html/community/tp-downloads/Building_Tut4.zip
File: /***/***/public_html/community/Sources/TPdlmanager.php
Line: 1193

and

---modstothemax.net/community/index.php?action=tpmod;dl=get313
2: filesize() [<a href='function.filesize'>function.filesize</a>]: stat failed for /***/***/public_html/community/tp-downloads/Building_Tut4.zip
File: /***/***/public_html/community/Sources/TPdlmanager.php
Line: 881

same as above also for lines 865, 858, and 850.


I'm not sure what to try next.  Thanks for any and all help.
Title: Re: File Uploads/Downloads are Empty
Post by: bloc on August 08, 2007, 01:02:18 AM
When you check the files in ftp, they have the a CHMOD of 600 or 644?
Title: Re: File Uploads/Downloads are Empty
Post by: Celtland on August 08, 2007, 01:17:33 AM
I just checked now - the latest "problem" file does have permissions set to 644.  You can view the download here:

http://www.modstothemax.net/community/index.php?action=tpmod;dl=item317

When setting the download file size in TP admin - that's for individual files (not the folder)?
Title: Re: File Uploads/Downloads are Empty
Post by: Celtland on August 08, 2007, 01:57:53 AM
My apologies - I have temporarily enabled Guest downloads on the that folder.  You should be able to see it now.
Title: Re: File Uploads/Downloads are Empty
Post by: IchBin on August 08, 2007, 02:00:48 AM
I just downloaded the file here at school just fine. Perhaps you have made the right change and just need to clear your cache.
Title: Re: File Uploads/Downloads are Empty
Post by: Celtland on August 08, 2007, 03:13:48 AM
Thanks!

** Edit **

I knew I responded too soon.  I cleared my cache and am still having the same problem - that download shows up as 0 bytes.  I'll keep plugging away - thanks for the help.
Title: Re: File Uploads/Downloads are Empty
Post by: bloc on August 08, 2007, 04:51:29 PM
It does with me too, 0 in size.

Could it be the actual prefix on it? i see its .7z. How about you rename it to zip for example, then try dl it? If it works then, then  maybe the headers sent for 7z files are wrong.
Title: Re: File Uploads/Downloads are Empty
Post by: Celtland on August 09, 2007, 03:09:22 AM
Thanks for taking a look, Bloc.  I have tried 7z, tar, and zip files - all with the same results - 0 bytes.  I'm not sure what to try next.
Title: Re: File Uploads/Downloads are Empty
Post by: G6Cad on August 09, 2007, 06:35:33 AM
I have seen and had about the same issues before, that time it was the permissions that were set wrong to the tp-downloads folder and the files inside it.

Try and change the permissions to 777 and also change the permissions for the files inside to 777.
Upload the file and try again after that.
Title: Re: File Uploads/Downloads are Empty
Post by: Celtland on August 09, 2007, 10:32:08 AM
Thanks G6.  I'll try that when I'm off of work.  Is there a setting I can change in TP - or one I can ask my host to change - that will make all future files uploaded set with permissions of 777?
Title: Re: File Uploads/Downloads are Empty
Post by: G6Cad on August 09, 2007, 12:19:02 PM
If you have FTP or Cpanel access you can change the permissions to the folders and files through there.

Another way to try is to use the Option in the package manager, but also there you will need your ftp account for the server so it can change the permissions.

If that's not working, you will have to ask your host to change the permissions for you.
Title: Re: File Uploads/Downloads are Empty
Post by: Celtland on August 09, 2007, 03:39:22 PM
Thanks - I'm sorry - I meant is there a way to make sure that whenever we upload any new files that they will automatically be set to 777?
Title: Re: File Uploads/Downloads are Empty
Post by: G6Cad on August 09, 2007, 07:31:39 PM
Im not sure, but if the mail folder (tp-downloads) have 777 they usually works as they should.
If not, you have to contact your host so they change the permissions to that folder and the content in it.
Title: Re: File Uploads/Downloads are Empty
Post by: Celtland on August 09, 2007, 07:43:16 PM
I made sure the folder was changed to 777, and I changed all the files in it to 777 as well.  It's still not downloading.  The problem archive is 4th in a series of 4 in our tutorials section.  I've looked at all the others and there is really no difference between any of them.  But it's the same with that one archive (and a few other files too) - whether they are uploaded to TP or as an attachment in a post, they always download as 0 bytes.  I wonder what's different about the computer at IchBin's school that allowed him to download it without any problems.
Title: Re: File Uploads/Downloads are Empty
Post by: Celtland on August 09, 2007, 07:52:03 PM
I just downloaded it via FTP without any problems.  I wish I knew what the issue is.
Title: Re: File Uploads/Downloads are Empty
Post by: G6Cad on August 09, 2007, 07:52:30 PM
Did you upload a new file after you changed the permissions ? Also did you clear your temp internet files and cache ?
Title: Re: File Uploads/Downloads are Empty
Post by: G6Cad on August 09, 2007, 07:53:31 PM
It's a permission issue, I had the same on the old server i was on, but Thurnok changes some settings on that server and after that it worked, so i guess you should contact your host and ask them to look in to the permissions there
Title: Re: File Uploads/Downloads are Empty
Post by: Celtland on August 09, 2007, 07:59:51 PM
I have cleared out all temp files and cache.  I changed the permissions on the existing file and when that didn't work, I tried uploading it again.  It's almost like it doesn's like the name - Building_Tut4.zip - the others were uploaded at the same time and they're exactly the same except for 1,2, and 3 - and they can be downloaded without any problems.  It seems to happen at random with different files.  I'll definitely have our host look into it.  Thanks!
Title: Re: File Uploads/Downloads are Empty
Post by: Celtland on August 09, 2007, 09:51:29 PM
We emailed our host and they have gotten back to us surprisingly fast.  They checked and all of the files/folders that we need are "owned" by us.  I'm at a loss...
Title: Re: File Uploads/Downloads are Empty
Post by: bloc on August 10, 2007, 11:48:53 PM
If its not consistant..rather occur randomly, then it has to be do with the actual files themselves.

Try a few things:
- extract and re-pack that file, uplaod with same name.
- upload current, but rename it in ftp, change the name in tpadmin as well so the downlaod is correct
- do both, re-pack and rename on ftp after upload

If there are differences here, it will tell you more.
Title: Re: File Uploads/Downloads are Empty
Post by: Celtland on August 11, 2007, 12:10:24 AM
I'm sorry I didn't put it in an earlier post - I did try the unpack/repack of the file contents and that didn't work.

- I just tried renaming the original file both on the server via FTP and in tpadmin, but when I downloaded the file it showed up as the previous name and is still 0 bytes.

- I also tried unpacking, repacking, uploading via TP, renaming via FTP and tpadmin - this time when I downloaded it the name was correct (the new name), but the file was still 0 bytes.
Title: Re: File Uploads/Downloads are Empty
Post by: bloc on August 11, 2007, 11:34:31 AM
I see. It must be something with the server then, after all. I just can't see where TP should be making differences between one file and another, when equal in size and type.
Title: Re: File Uploads/Downloads are Empty
Post by: Celtland on August 11, 2007, 03:29:43 PM
Thanks Bloc.  We'll explain the issue in more detail to them and see if they can figure it out.