I have a form in which I have 40 questions and each question has a file upload control associated with it. Now when a user sees a document with that form, all the files go down at the bottom which looks very ugly and confusing. Is there a way
a) So that I could have a link for each added file next to the question. or
b) Have all file links at the bottom but instead of the actual file name something like q1.doc, d2.doc, q3.doc and so on.
Thanks for your reply. But this gives url with the attachment names. I dont want to do that. I want my own name instead of attachments name e.g. if the first attachment name is fileabc.doc, second is filexyz.doc, i want something like file1.doc, file2.doc and so on.
What I want is the question name to the url. So if the users have added files for question, 1,2,3, and 9 I want the links to be like
file1.doc, file2.doc, file3.doc and file9.doc and not the actual file names.doc.
Use a seperate visible computed for display field for each question (e.g. DisplayAttachmentsQ1, DisplayAttachmentsQ2 etc.) and replace @AttachmentNames in the formula with @Subset ( @Subset ( @AttachmentNames ; n ) ; -1 ) where n is the question number.
If you want the attachments names to conform to a naming convention you’ll have to script a server agent that detaches then reattaches the files with the name you specify and then deletes the detached file from the file system.
Thanks for your post. However I’m still not very clear. Can you please explain what exactly you mean with a couple of examples. Also keep in mind that we may have attachments for Q1,Q2 and Q9 only and no attachments for Q3-Q8. How would it work in that case?
The first part of my solution deals with the untidyness at the bottom of the page/document. If you spend a bit of time experimenting with that you’ll have gone a long way to solving what sounds like a largely cosmetic issue.
As for the server agent detaching files I think that may not be a viable solution now that you’ve further delineated the issue. Perhaps the users of your application can meet you half way and agree to provide files that conform to a naming convention you specify?
Subject: file upload control on the web–My Solution
For anybody trying to do something similar. I used some tips from here and some from codestore.org. Thank you everybody for their input and ideas especially Jake.
For each upload control, I gave it an id in the html attributes like FileAttachQ1
Then I have a computed field with the same formula and “type=hidden” in html attributes.
On save Im setting the value of my hidden field with the file path usign javascript.