php - How to rename image or add random number to the image to make unique name -


  $ target = "अपलोड करें"; $ Targetx = $ लक्ष्य बेसएनाम ($ _FILES ['फोटो'] ['नाम']); अगर (move_uploaded_file ($ _ FILES ['photo'] ['tmp_name'], $ लक्ष्य x)) {} else {} $ targetx = $ target बेसएनाम ($ _FILES ['photo2'] ['नाम']); अगर (move_uploaded_file ($ _ फ़ाइलें ['photo2'] ['tmp_name'], $ लक्ष्य x)) {} else {} $ targetx = $ लक्ष्य बेसएनाम ($ _FILES ['photo3'] ['नाम']); अगर (move_uploaded_file ($ _ फ़ाइलें ['photo3'] ['tmp_name'], $ लक्ष्य x)) {} अन्य {} $ targetx = $ लक्ष्य बेसएनाम ($ _FILES ['photo4'] ['नाम']); यदि (move_uploaded_file ($ _ फ़ाइलें ['photo4'] ['tmp_name'], $ लक्ष्य x)) {} else {गूंज "माफ़ करना, आपकी फ़ाइल अपलोड करने में एक समस्या थी।"; } $ Photo = ($ _ फ़ाइलें ['फोटो'] ['नाम']); $ Photo2 = ($ _ फ़ाइलें [ 'photo2'] [ 'नाम']); $ Photo3 = ($ _ फ़ाइलें [ 'photo3'] [ 'नाम']); $ Photo4 = ($ _ फ़ाइलें [ 'photo4'] [ 'नाम']);  

प्रत्येक फ़ाइल के लिए नीचे कोड का प्रयोग करें:

  $ File = $ _FILES ['photo1'] ['नाम']; $ Ext = pathinfo ($ फ़ाइल, PATHINFO_EXTENSION); $ Photo = "newfile _"। समय ()। रैंड (5, 15)। "$। $ Ext $ targetx = $ लक्ष्य $ तस्वीर;  

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -