I would be careful about how the file is transferred. You do not want the user to include directory structures in the file name (such as ../../../../../file.ext). This could be a very bad thing. In this situation I would think that it is best to error on the side of caution. There is to great a possibility to introduce a security hole. Dont forget to taint check.