⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

upload files to custom path



kaleemullah360
  • profile picture
  • Member

Posted 18 February 2015 - 11:12 AM

I want to uplad An APK an Icon and a Banner

 

get maximum [ ID ]from databse increment it and create directoy with name of ID in [ UPLOADS ] folder then store this relative path to data base like this:[ uploads/284/icon.jpg ]

 

 

../uploads/667/games.apk
../uploads/667/games_banner.jpeg
../uploads/667/games_icon.png

../uploads/668/games.apk
../uploads/668/games_banner.jpeg
../uploads/668/games_icon.png

../uploads/669/games.apk
../uploads/669/games_banner.jpeg
../uploads/669/games_icon.png

../uploads/670/games.apk
../uploads/670/games_banner.jpeg
../uploads/670/games_icon.png

../uploads/671/games.apk
../uploads/671/games_banner.jpeg
../uploads/671/games_icon.png

../uploads/672/games.apk
../uploads/672/games_banner.jpeg
../uploads/672/games_icon.png

../uploads/673/games.apk
../uploads/673/games_banner.jpeg
../uploads/673/games_icon.png

 


Amit Shah
  • profile picture
  • Member

Posted 19 February 2015 - 03:40 AM

Hi there,

 

Well i wont recommend you using max id or so. And this feature can be achieved by making a callback post insert or update where what you are supposed to do is.. create a new folder from the mentioned id and move relevant uploaded file from base upload directory to new folder created. Also what is recommended u do is post that process, update in the tables with the filenames to be added up with that foldername and directory seperator (/) ...

that way .. you shall still retain the upload functionality management by gc and also be able to segerigate the uploads.