This topic has been closed for further discussion.
Member
From: Vilnius / London
Registered: 2006-01-31
Posts: 61
I've been thanked 0 times.
Offline
Hello site-reference,
Haven't been here for ages (was occupied mastering css and left marketing issues aside for a while). Great to see the new (at least to me) design. it's really user-friendly, well done!
Want to ask for help with php file upload script. I need to add functionality to my html form - it should:
1) take a file from user's computer;
2) check file extension and allow only certain extension (ms word .doc);
3) check file size and allow files under 100kb;
4) send the file as an e-mail attachment
I don't know php well enough to write such script myself so tryed using different ready scripts but they all had functionality i don't need and didn't do some basic things. can you please recommend me something and/or ideally give such script 
Thanks a lot, any help is greatly appriciated.
Member
From: San Antonio, TX
Registered: 2006-08-07
Posts: 596
I've been thanked 34 times.
Offline
As PHP is a server side tool, I think you're gonna need to think Javascript instead. The bad news is I'm not fully up to speed on Javascript, so I can't help you beyond redirecting your efforts.
Member
From: Vilnius / London
Registered: 2006-01-31
Posts: 61
I've been thanked 0 times.
Offline
Steven_A_S wrote:
As PHP is a server side tool, I think you're gonna need to think Javascript instead. The bad news is I'm not fully up to speed on Javascript, so I can't help you beyond redirecting your efforts.
Thank you Steven but I am sure namely PHP is needed! And in fact there's a working script I'm trying to modify. It's only that I can't add a file size and type check... the script stops working. I read through hundred tutorials and tryed a dozen of working examples... They all either provide excessive functionality or too basic. And my knowledge of php is not sufficient to modify them correctly.
Altogether it doesn't seem to be an over-specific thing. I believe that many webdevelopers have such sort of script in their code libraries. No point to write the application from scratch each time you are putting up an e-mail form...
That's why my request 
Administrator
From: Colorado, USA
Registered: 2006-02-15
Posts: 2427
I've been thanked 105 times.
Offline
Don't know for sure if this helps but take a look at this site.
http://celerondude.com/php-uploader-v6
Attention designers and webmasters - "The Beauty of CSS"
Valid Web Designs tutorials on HTML, XHTML and CSS
Home Security Systems
Member
From: Vilnius / London
Registered: 2006-01-31
Posts: 61
I've been thanked 0 times.
Offline
ColoEagle wrote:
Don't know for sure if this helps but take a look at this site.
http://celerondude.com/php-uploader-v6
This is what i was talking about - a large file upload application. It has a lot more extensive functionality than i need. While the desired script will only attach users file to an e-mail (check it for size and file type) and send to me. i don't want to store files on server either.
Member
From: Pell City, Alabama USA
Registered: 2004-11-17
Posts: 2085
I've been thanked 5 times.
Offline
unfortunately you will not be able to check the file size and extension on the client side
TombOfTheMutilated.NET - Destroying The Minds of America's Youth Since 2001
Member
From: Vilnius / London
Registered: 2006-01-31
Posts: 61
I've been thanked 0 times.
Offline
Mutilated1 wrote:
unfortunately you will not be able to check the file size and extension on the client side
I am dying to get it working any possible way - on a client or server side... whatever. There are millions websites using "file to email" functionality and thus there has to be a standard solution for this task but I am not finding it.
Member
From: Pell City, Alabama USA
Registered: 2004-11-17
Posts: 2085
I've been thanked 5 times.
Offline
well - you can ignore any mention of using javascript because javascript doesn't have access to your filesystem by design - its built specifically so that it cannot access your files
start by making a form - thats easy enough
then you just have to make some PHP to check the filesize and extension and e-mail it - thats pretty easy too
TombOfTheMutilated.NET - Destroying The Minds of America's Youth Since 2001
| Never |


