The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Rename File before move_uploaded_file() PHP?
masonh928
post Sep 29 2015, 03:53 PM
Post #1


Serious Coder
*****

Group: Members
Posts: 253
Joined: 17-August 13
From: Indiana
Member No.: 19,570



I want to assign the person's file to their ID like this for example.

User Uploads file named: Ninja.png
PHP renames file by grabbing User ID: 23.png
PHP moves uploaded file to permanent Resting place: /Community/Avatar/ Directory


Obviously I don't need to save the user's previous avatars, so I'll just override them if they want to update their avatar/profile img.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Sep 29 2015, 04:04 PM
Post #2


Programming Fanatic
********

Group: Members
Posts: 1,735
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



QUOTE(masonh928 @ Sep 29 2015, 03:53 PM) *

I want to assign the person's file to their ID like this for example.

User Uploads file named: Ninja.png
PHP renames file by grabbing User ID: 23.png
PHP moves uploaded file to permanent Resting place: /Community/Avatar/ Directory


Obviously I don't need to save the user's previous avatars, so I'll just override them if they want to update their avatar/profile img.
Well, I have not any file uploads that needed to be taken out of the default upload path and moved to some other path. But, according to the docs here and samples it should be no problem. Post back if you get an actual error message.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
masonh928
post Sep 29 2015, 04:15 PM
Post #3


Serious Coder
*****

Group: Members
Posts: 253
Joined: 17-August 13
From: Indiana
Member No.: 19,570



Ok, thnx! I will try, I have tried in the past, but that was prior to my taking an internship in web development and design. So will try this again, and see what yields of it.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 7th July 2020 - 04:10 AM