close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

retrieve upload in details page?

Thread began 2/08/2012 2:58 pm by gary.brett434358 | Last modified 12/19/2015 6:58 pm by Ray Borduin | 3259 views | 10 replies |

gary.brett434358

retrieve upload in details page?

Hi,
I have successfully created a file upload option on an insert page that uploads to a folder and inserts filename into a table.

On the details page I added a field and dragged the filename field from the recordset onto the form, this shows the filename but doesn't allow the user to view the file. I can view images if required by inserting image then choosing dynamic field, but all my uploads are documents, pdfs, docs etc,

Where possible I need to allow users to view all documents they have uploaded and add more via the update page.

If user has uploaded 3 pdfs these would need to be linked on the details page, clicking would open:

CaseDocuments/upload1.pdf
CaseDocuments/upload2.pdf
CaseDocuments/upload3.pdf

Any help appreciated really cannot find any documentation on DFP whatsoever.

Regards

Sign in to reply to this post

Ian S

You need to create your link to the document by using the standard A tag.

Then add your dynamic code to the A tag to reference the dynamically created file name.

e.g.

<a href="/CaseDocuments/<?php echo $row_recordset['filename1']; ?>" target="_blank"><?php echo $row_recordset['filename1']; ?></a>

Cheers
Ian

Sign in to reply to this post

gary.brett434358

Originally Said By: Ian S
  You need to create your link to the document by using the standard A tag.

Then add your dynamic code to the A tag to reference the dynamically created file name.

e.g.

<a href="/CaseDocuments/<?php echo $row_recordset['filename1']; ?>" target="_blank"><?php echo $row_recordset['filename1']; ?></a>

Cheers
Ian  



Hi Ian, before I dive into this one, if I have read this correct, I need to manually add a field for each file created into each case?

My database is such that 1 case could have many documents, uploaded at various different times across a period of time, I wouldnt know when they are uploaded.

Case001 - file1.pdf
Case001 - file2.pdf
Case003 - file1.pdf
etc etc etc

Is DFP not able to generate these links on the fly as they are uploaded?

Kind regards

Gary

Sign in to reply to this post

Jason ByrnesWebAssist

  Is DFP not able to generate these links on the fly as they are uploaded?  



no DFP cannot generate links. DFP can only upload the files, it is up to you to store the file name in the database, and decide what to do with that information (in your case, create links)




  My database is such that 1 case could have many documents  



so you are creating a one to many relationship, to do this, you need to have a cases table and a files table


your files table would have a column for the file name, and a column for the caseID

when a file is uploaded, store the file name in the file name column, store the caseID for the case the file relates to in the caseID column


to create the links, you create a recordset that filters the files table on the corresponding case using the caseID column

Sign in to reply to this post

gary.brett434358

Originally Said By: Jason Byrnes
  so you are creating a one to many relationship, to do this, you need to have a cases table and a files table


your files table would have a column for the file name, and a column for the caseID

when a file is uploaded, store the file name in the file name column, store the caseID for the case the file relates to in the caseID column


to create the links, you create a recordset that filters the files table on the corresponding case using the caseID column  



Hi Jason, the db structure is already built and I have recordset to display the content of the documents table, this is no problem. If if cant show users the uploads then I will need to display this table on a page filtered to logged in user, but does that still leave me without the ability to format the 'filename' field to a href?

I am trying to insert the table using DA repeat table but it always returns zero records, no matter which recordset I base it on.

Cheers

Sign in to reply to this post

Jason ByrnesWebAssist

  If if cant show users the uploads  




but you can show the users the uploads, by storing the file names like I suggested in my previous reply.

Sign in to reply to this post

gary.brett434358

Thanks again, have applied Ians a href example to the required table cell and all is good now.

My initial query was that I would have liked to to display a list of individual filenames in the details page without a table. This is just as good so thank you.

Cheers

Sign in to reply to this post

Ian S

Glad its working Gary.

To be honest, I think storing the data in a table makes it much easier to manage in terms of updating files and deleting them. It also enables you to keep a log of who has uploaded / deleted what should you need that in the future.

Cheers
Ian

Sign in to reply to this post

gary.brett434358

Originally Said By: Ian S
  Glad its working Gary.

To be honest, I think storing the data in a table makes it much easier to manage in terms of updating files and deleting them. It also enables you to keep a log of who has uploaded / deleted what should you need that in the future.

Cheers
Ian  



Thanks Ian, yes your right, once I have styled it and filtered by logged in user I expect it will do the job just fine. Now if I could add an icon for the uploaded doc type in a column, Word, PDF!!! Only joking..

Thanks again, much appreciated.

Gary

Sign in to reply to this post

Ian S

  Now if I could add an icon for the uploaded doc type in a column, Word, PDF!!! Only joking..  



Thats very possible ;-)

When you upload the file you can store the already created file extension binding from DFP and store it in a database. Then you can refer to that value to display the correct icon!

Happy days!

Cheers
Ian

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...