The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
file uploader - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28) +--- Forum: Modifications and Hackery (https://userspice.com/forums/forumdisplay.php?fid=29) +--- Thread: file uploader (/showthread.php?tid=562) |
file uploader - firestorm - 05-17-2017 hey, thought i'd implement a file uploader, mainly for images but other files too, form uploads image to directory on server, in my case users/uploads/avatar . you can then either save the filename or full file path to the database, in my case i added a row to the Code: profiles the files we need are: patch-4.2.6-uploads.php - place somewhere so you can navigate to it in the browser within userspice, maybe root class.upload.php - place in users/classes/ uploads.php - place in users/includes/ patch-4.2.6-uploads.php: navigate to this in browser, it will magically add the required db row to table Code: profiles class.upload.php: best left untouched https://pastebin.com/DpKmdXex uploads.php: adapt to your needs-change things like image types, locations, db insertion etc https://pastebin.com/iLKrM1J8 Next we need the form: adapt to your needs https://pastebin.com/ZJ353CHa heres how the form looks: https://pasteboard.co/7nRsmlvAa.png you could go one step further and upload without page refresh using ajax as snippet below, just need a way to refresh the image preview otherwise page refresh is required. https://pastebin.com/BjDfdare RE: file uploader - shoropio - 09-21-2018 I tried this but it did not work |