Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Retrieve FileIDs?Retrieve FileIDs?
Previous
 
Next
New Post
3/11/2006 10:09 PM
 

I'm using a catalog system for my store that enables bulk product uploads.  If I upload or ftp image files to my database before assigning them to products I can assign them later by image FileID.  However, I don't know how to retrieve the FileIDs.

Can someone give me give me an easy method for retrieving FileIDs from the database without using a lot of code?

My site is hosted through Godaddy.com and I'm most familiar with the admin/host capabilities of DNN.  I'm not much of a programmer or very familiar with SQL...

Thanks in advance for any help.

 
New Post
3/13/2006 3:20 AM
 

Linking fileIDs to filenames is done in stored procedures. If you look at the GetLink sproc, that is used for the links module (which can link to filenames), then you see this (abbreviated for readability):

select 
    [...]
    'URL' = case when Files.FileName is null then Links.URL else Files.Folder + Files.FileName end,
    [...]
from Links
    [...]
   left outer join Files on Links.URL = 'fileid=' + convert(varchar,Files.FileID)
where [...]

What is done here is that if the link points to a file (so a corresponding record exists in the files table), the URL is calculated from the values from the Files table, else the value from the Links table is used.

The other way around, if you want to find the fileID by fileName, you can use the core sproc GetFile, which looks like this:

CREATE procedure dbo.GetFile

@FileName  nvarchar(100),
@PortalId  int,
@Folder nvarchar(200)

as

select FileId,
       FileName,
       Extension,
       Size,
       WIdth,
       Height,
       ContentType
from Files
where  FileName = @FileName AND Folder=@Folder
and    ((PortalId = @PortalId) or (@PortalId is null and PortalId is null))

HTH

Cheers,

Erik


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
3/13/2006 7:49 PM
 
 Got it!  Thanks a lot!
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Retrieve FileIDs?Retrieve FileIDs?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out