This is a migrated thread and some comments may be shown as answers.

Dynamic Upload Folder Name

3 Answers 110 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
bradley baker
Top achievements
Rank 1
bradley baker asked on 13 Nov 2009, 10:46 PM
How would I make it so the upload folder is the numeric ID value of the inserted record?  IE in my PHP site I have the files being uploaded into a tmp folder which is then dynamically renamed to the ID value of the recored inserted.  So all the files are in 1 folder with the ID value of that record.

IE
path/app_folder/docs_for_app_folder/unique_id_folder
../HelpDesk/HelpDeskAttachments/1001   (1001 being the auto generated id from SQL)

3 Answers, 1 is accepted

Sort by
0
bradley baker
Top achievements
Rank 1
answered on 17 Nov 2009, 04:16 PM
No one has an idea?
0
Accepted
Veselin Vasilev
Telerik team
answered on 18 Nov 2009, 01:22 PM
Hi bradley baker,

Here is what you need to do: do not set the TargetFolder (nor the TargetPhysicalFolder) properties of the upload. Then, in the event handler of the submit button insert the record in your database and get the ID. Then create the folder with that name and use the SaveAs method of the UploadedFile object to save the file to that folder.

You can check this help topic for more information.

Regards,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
GOURVEZ JJ
Top achievements
Rank 1
answered on 16 Dec 2009, 05:10 PM
Hi,

thanks for your answer

I don't find how to upload file with PHP script :(.

I have an php script fonctionnaly but when the file is on my server it is corrumped.

I only changed url service beacuse I don't see the modification to realise

Do you have an example ?

Thanks

Tags
Upload (Obsolete)
Asked by
bradley baker
Top achievements
Rank 1
Answers by
bradley baker
Top achievements
Rank 1
Veselin Vasilev
Telerik team
GOURVEZ JJ
Top achievements
Rank 1
Share this question
or