- This topic is empty.
August 10, 2010 at 3:08 pm #29880allampatuParticipant
i’m looking for tips’n’tricks to build a script that allow an admin to upload pdf file and automatically in another page there’s a link to download that file.
thanks a lotAugust 10, 2010 at 6:30 pm #81307BobMember
Do you use WordPress? If so, when you create a new post, you can upload/insert all type of stuff – images, video, audio and media. Click that media button (its right above the box in which you type your new post) and you can then select the pdf file you want to upload. When you uploaded the file, there’s a button in the next screen that says: Insert into post. That will insert a link to the file in your post at which people can download the file.
Ofcourse, if you don’t use wordpress – try this: http://www.tizag.com/phpT/fileupload.php, at which I’m sure you can find more info about PHP uploadAugust 10, 2010 at 7:18 pm #81316allampatuParticipant
hey bob, thanks
no i’m not using wordpress right now, i’m working on a simple php site.
i checked out your link it doesn’t seems the right stuff that i’m looking for but it’s a nice start.September 18, 2010 at 4:39 pm #79551The-MarshalMember
can anyone answer really i need the answer alsoSeptember 24, 2010 at 3:49 am #79131ImpInaBoxMember
There’s two parts to this: the file upload bit and the link generating bit. You probably need to make sure that the file gets uploaded to a specific directory reserved for such things
The file upload bit is covered by something like <input type=”file”….. >. The ‘action’ points to a form processor that checks out the file to make sure it’s what you think it is (size, file type etc), uploads it (to PHP’s temp directory) and then moves it to your uploaded files directory with move_uploaded_file().
Your ‘other page’ will need some PHP code to check out the uploaded files directory and display links to anything it finds there.
There’s a tutorial on uploading files here. I’ve not read it thru in detail but, at a glance, it seems to cover all the important bits.
One word of warning tho – do make sure that only authorised people can use the upload form and the form processor or you’ll get all sorts of crap in there!May 4, 2011 at 12:11 pm #47385The-MarshalMember
Thanx alot ImpInaBox it works with me…
- The forum ‘Back End’ is closed to new topics and replies.