searls03 Posted April 10, 2011 Share Posted April 10, 2011 so I want to know how I could upload a document associated with an event.......with a form upload.......but where do I store it at and make it display in the view page for the event......? Quote Link to comment https://forums.phpfreaks.com/topic/233285-document-upload/ Share on other sites More sharing options...
spiderwell Posted April 10, 2011 Share Posted April 10, 2011 file uploading is pretty straight forward, and theres plenty of scripts out there to use. it could be saved directly into the database as a blob (binary object) or just saved to the server, which is the method i use. i would suggest the database table has an ID, event name, and image column, then when the form is submitd the file is uploaded (hopefully) successfully, then enter the event name and image filename into the database. to later pull that image, use SQL to grabthe row from the database and echo the imagename inside an html img tag bit like below. dont forget paths to where the image is stored too echo "<img src=\"" . $row['image'] . "\">"; Quote Link to comment https://forums.phpfreaks.com/topic/233285-document-upload/#findComment-1199748 Share on other sites More sharing options...
searls03 Posted April 10, 2011 Author Share Posted April 10, 2011 how would I make it so that if the format was pdf.....it could be downloaded? Quote Link to comment https://forums.phpfreaks.com/topic/233285-document-upload/#findComment-1199750 Share on other sites More sharing options...
spiderwell Posted April 10, 2011 Share Posted April 10, 2011 same principle really only make an hlink to the pdf instead of an image tag when you want it to be downloaded Quote Link to comment https://forums.phpfreaks.com/topic/233285-document-upload/#findComment-1199755 Share on other sites More sharing options...
searls03 Posted April 10, 2011 Author Share Posted April 10, 2011 ok thanks! Quote Link to comment https://forums.phpfreaks.com/topic/233285-document-upload/#findComment-1199756 Share on other sites More sharing options...
searls03 Posted April 10, 2011 Author Share Posted April 10, 2011 sorry, I am having a block right now..........could you help me get started with a code to upload directly to server from a form field? Quote Link to comment https://forums.phpfreaks.com/topic/233285-document-upload/#findComment-1199836 Share on other sites More sharing options...
spiderwell Posted April 11, 2011 Share Posted April 11, 2011 just google php file upload, theres 100's of examples Quote Link to comment https://forums.phpfreaks.com/topic/233285-document-upload/#findComment-1199839 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.