This topic is locked

Image Upload File Names

4/13/2010 7:56:48 AM
ASPRunnerPro General questions
M
mark.field author

Hi
I have built an application to register business queries which requires images to be uploaded and stored.
I've used two sql tables to store the data, both of which have an ID field which is auto-generated. The master table holds the query details, and the child table holds the image url details and supporting text.
The master-detail relationship works fine in asprunner as I have a field on the child table called MasterID which equals the ID field on the master table. There can be many images for each query.
My question is......
I want to automatically prefix the filename when the image is uploaded with the MasterID value. Eg I upload picture.jpg for query ID 10, I want the image name to be stored as 10-picture.jpg in both the sql table and the file system directory that it gets uploaded to.
Any ideas?
Thanks in advance

Sergey Kornilov admin 4/13/2010

Check this article for inspiration:

http://xlinesoft.com/asprunnerpro/docs/rename_uploaded_files.htm
SESSION("<table name>_masterkey1") stores the current value of master key.

More info on session variables: http://xlinesoft.com/asprunnerpro/docs/asprunner_session_variables.htm