I see that you want to compute a full filename, with path, using os.path.join. The first parameter to os.path.join is the name of a folder. For this to work, the 2nd parameter will need to be a string, containing the name of the file, within that folder, that you want to create.
What I was trying to do is to save the user images on my pc(server) so I tried to convert the input image and save it in file1. I used os.path.join to save converted images into my pc folder.
Here maybe I am using the wrong concept because I can’t think of any other way to save user images on my pc. If there is a way please guide it would be helpful.
In this case, you can imagine that there are two parts of saving a file:
Knowing where to save it (i.e., what path and file name to use).
Knowing how to save it.
Usually, your program needs to figure these out in this order. Which is why I asked about #1. If you don’t have a name for the file, then the rest of it is not going to work.
So let’s finish with #1. What name do you want to use? Once you know that, then we can work on making your code apply that information.