Jump to content

Recommended Posts

Hello,

I was just learning php on my own and ran across a question. (right now im learning imap so ill ask it that way)

 

Imap allows me to connect to external email account :). Now i was wondering, say i want to upload a file to my email account BUT i dont want to upload the file to my server and than send it, is there a way?

 

Like i can visit hello.php and say i upload a wazup.wav. Now i know i can upload that file to server, than send an email to my email account with the uploaded file (on the server). But is there a way i can do that without needing to upload to the server and just send the time to my email account?

 

Just wondering ;)

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/83511-is-it-possible-using-php/
Share on other sites

no there is not a way of doing this (with php) because php does not do anything in your script until it recieves the file.  If you were using another language, you could have it recieve one packet of the file, send one packet of the file, delete that packet, and repeat.

 

But php cannot do this.

If you were using another language, you could have it recieve one packet of the file, send one packet of the file, delete that packet, and repeat.

 

But php cannot do this.

 

The Email will need to encode the file.. so sending packets while the upload is in progress will not work correctly anyway !!

its not a limit of php its a how email attachments works,

even if you used perl or cgi to support the upload, your still have problems talking to the mail server....

 

You can upload the but instead of moving the file from the tmp storage area, you could just encode it, and add that to the email.. the file itself can then be deleted, and the email will still contain the file for downloading..

 

EDIT: oh and as a side note.. PHP CAN send one packet at a time.. ie sockets

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.