close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Create dynamic folders with ID

Thread began 9/19/2012 7:29 am by Morgan | Last modified 9/21/2012 12:53 pm by Jason Byrnes | 1005 views | 6 replies |

Morgan

Create dynamic folders with ID

File upload extension Digital File Pro in DB

Need help with this, cant get it to work proper..
I want folders to be created with a Album id on insert then upload a albumcover picture, but fail to do it. I need to pick up the ID, but im failing and not sure im thinking right atm!! haha

Whats the proper way to go to make this happen?
I have tryed to pick up the session id of the id, not working. I get it to work with the album name, but that will not work in the long run due to special chars.


I want the album id to be the foldername.
I think ive mange to sort this out before, but i have forgot how to do it... and i cant get to the site i did it on too see the code.
Didnt old DFP have triggers?

/Morgan

Sign in to reply to this post

Morgan

Ok, found out what the problem was, i had it right but the WA DataAssist Insert was placed after the WA_UploadResult1 Params Start.
Thats why i didnt get it to work as intended.

Now its working like a charm, i hope, still need some more testing!! :)

/Morgan

Sign in to reply to this post

Morgan

nvm, it creates the folders and puts the image in that folder, but the file info dont get inserted in to the db.

/Morgan

Sign in to reply to this post

Morgan

Solved the problem with adding a new field in my tbl and had a hidden field to take the date and time, then i save it to the db as album_datetime. That will do for now.


But feel free to explain how to use the insterted ID as a creator of the dynamic folders with out the use of session. Think im looking at it the wrong way atm.

//Morgan :)

Sign in to reply to this post

Jason ByrnesWebAssist

using the album id in the file name wont work because of the order of how things happen.


normally, the File is uploaded to the server first, then the file name is stored in the database.

you cant use the ID of the inserted record in the folder name for the file because the file has not been uploaded yet.


you then changed the order so that the file was uploaded after the record was inserted, this caused the file name to not be stored in the database. That happened because the file was not uploaded yet.

The only real way to get this to work is to have the insert occur, this saves the ID to a session.

then have the upload occur, and use the session for the folder name. Then do an update to update the record with the uploaded file name, use the Session variable to tell it which record to update.

Sign in to reply to this post

Morgan

Ty Jason for your reply, sounds like way to many steps to get that to work as i first wanted, now i use a hidden field and use that for the creation of the folders, works better then i first thought. :) Now i get a better overlook of the folders, and a better structure with foldernames: album_20120919145645.

One more question, if i should have used album names, how do i swap out my country letters like: ÅÄÖ, åäö for AAO, aao?

Regards
Morgan

Sign in to reply to this post

Jason ByrnesWebAssist

that would require hand coding using the str_replace() function.

see the following for more details:
function.str-replace.php

Sign in to reply to this post

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...