• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

some help with php please?

zimu

Diamond Member
i posted this on programming a week back and still don't have any responses...

can anyone help me with PHP. i'm trying to send a server-side attachment using email. basically server has a 20MB file, and i want to email it to one of my accounts. i've tried numerous mime email things on the web, none work. does anyone know how to do this in a way that'll work?!

thanks in advance.
 
I read a tutorial once ... I think it was on SitePoint.com ...

Anyways ... a 20mb file will timeout during upload via a browser to the web server.

Check out sitepoint .... good stuff there ...
 
is this a one time deal or do you plan to do this over and over? If it's a one-shot, fire up AIM or setup FTP on the server.

-=bmacd=-
 
The file is on the server already? (Meaning you don't have to upload it -- only send it via mail?)

There could be a size limit on email attachments (is this your server, or a cohosting solution?). I'm entityat on AIM if you need to ask questions.

Rob
 
Originally posted by: GideonX
php has a size limit of 2MB.

That's a POST size limit (default; can be changed), and all he's said so far is the email is going from server -> other server (no need for file uploading/post).

Rob
 
actually, post limit is 8MB, upload limit is 2MB

from php.ini:

post_max_size = 8M
upload_max_filesize = 2M

one way or another, 20MB will not fly through php.

edit: unless of course, he starts messing with the conf file himself...but 20MB through PHP is just not exactly efficient.
 
Originally posted by: GideonX
actually, post limit is 8MB, upload limit is 2MB

from php.ini:

post_max_size = 8M
upload_max_filesize = 2M

one way or another, 20MB will not fly through php.

edit: unless of course, he starts messing with the conf file himself...but 20MB through PHP is just not exactly efficient.

That's default, I guess. I have mine set differently. 🙂

Regardless, like I said originally, he still hasn't said if this requires uploading, or if the file is already on the server that is running the script. If it's already there, this should be simple.

Edit: And what's wrong with uploading 20MB through PHP? (assuming, of course, that you actually have the need to upload that much and a web interface is all you can use). I'm not really sure what you mean by "inefficient."

Rob
 
Sorry for the delay guys!! Here are my responses:

Originally posted by: bmacd
is this a one time deal or do you plan to do this over and over? If it's a one-shot, fire up AIM or setup FTP on the server.

-=bmacd=-

What I was hoping to have a daily/ once every two day email sent out to my other account on another server (not gmail.) i want it to be fully automated, i was going to use cron jobs in cpanel to execute a PHP document which would run the backup and email it at a specified time.

The file is on the server already? (Meaning you don't have to upload it -- only send it via mail?)

There could be a size limit on email attachments (is this your server, or a cohosting solution?). I'm entityat on AIM if you need to ask questions.

Rob

Yes, the file will already be on the server

where can i find the php.ini file?? its not my own server, its a web hosting company. can i modify the php.ini even?
 
oh and another thing. when i send myself the file on an email account on the SAME server, it goes through just fine- even thouhg its 23 or whatever MB. but if i try sending it externally it gives me a delivery failure stating that the message is too big.

does that mena there's no file size limit or a different variable that controls how big a file can be that is sent to an email account in the same domain?
 
When you send it to yourself it doesn't go anywhere....sending it remote you are dealing with php limits, the server's own limits, another server's limits and any in between.

Email was not designed for large attachments.

Don't do it...the way the internet and sendmail works you can have that 20mb floating through china and back.
 
Why do you need to email it? Why not just have it ftp it to a remote server and then you will download those backups if/when you need them?
 
Most MTA's have a default email size limit of 10mb, this is after it's been encoded so reduce it about 30% for the actual file size (unless it's a text file). You would have to post the error message but I bet the remote MTA is rejected the email because it's larger than the limit the MTA imposes.
 
i don't know php, but i know programming, why don't you partition the file, then reassemble it on client side?
haha, sorry, i really don't know php, but that's what i would do.
 
Back
Top