I have a textarea where the user can input notes about a certain product. After input, the user saves the form and the saved text should be stored as an attachment. How do i do this??
not emailed, but stored. The text is stored as an attachment and available to the user to open if needed...do you know what i mean?
So you want to save it as a text file and allow the user to open it with a link like <a href="textfileabc.txt" target="_blank">Click to open your file</a> ????
You would need sessions and a database to do this properly but the script below should get you started. You need to use a server side script eg php to do this, it can't be done using Javascript. $file = fopen("myTextFile.txt","w"); fwrite($file,"This is where the contents of the text file goes"); fclose($file); PHP: for more info see http://www.php.net/manual/en/function.fopen.php
Just to elaborate.. you would also need to copy the uploaded file from the tmp directory to where you want it to be located. You should also rename the file accordingly.
Ok, i have the text entered by the user written to a file. Now, how can i take that file and create a link to it and then display that link? Anyone??
If you are creating the file in yoursite.com/files/file1.txt then you can just do a normal link to this fiile like you would to a web page.