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 ...File upload permissionsFile upload permissions
Previous
 
Next
New Post
10/7/2006 7:49 AM
 

Anyone that can help me how exact to change the store procedure

 
New Post
10/12/2006 10:01 AM
 
mitmit wrote

Anyone that can help me how exact to change the store procedure

Here's the original stored procedure out of 3.3.5.

Then SELECT SCOPE_IDENTITY() statement is moved up into the IF @FileID IS NULL block as shown in red.

Hopes this helps with your problem.

 

CREATE PROCEDURE dbo.AddFile
 @PortalId    int,
 @FileName    nvarchar(100),
 @Extension   nvarchar(100),
 @Size        int,
 @WIdth       int,
 @Height      int,
 @ContentType nvarchar(200),
 @Folder      nvarchar(200),
 @FolderID    int

AS

DECLARE @FileID int
SET @FileID = (SELECT FileId FROM Files WHERE FolderID = @FolderID and FileName = @FileName)

IF @FileID IS NULL
 BEGIN
  INSERT INTO Files (
    PortalId,
    FileName,
    Extension,
    Size,
    Width,
    Height,
    ContentType,
    Folder,
    FolderID
  )
  VALUES (
    @PortalId,
    @FileName,
    @Extension,
    @Size,
    @Width,
    @Height,
    @ContentType,
    @Folder,
    @FolderID
  )
  SELECT SCOPE_IDENTITY() 
 END
ELSE
 BEGIN
  UPDATE Files
   SET FileName = @FileName,
    Extension = @Extension,
    Size = @Size,
    Width = @Width,
    Height = @Height,
    ContentType = @ContentType,
    Folder = @Folder,
    FolderID = @FolderID
   WHERE  FileId = @FileID
 END

 

UPDATE Folders
 SET LastUpdated = getUtcDate()
 WHERE FolderID = @FolderID

--SELECT SCOPE_IDENTITY()
GO

 
New Post
10/17/2006 8:47 AM
 

Just a little update to the stored proc changes.

It's also necessary to add a new statement in the ELSE block to return a valid FileId when the file already exist and an update is preformed.

Add the following statement shown in red to the ELSE block in addition to the previous change -

ELSE
 BEGIN
  UPDATE Files
   SET FileName = @FileName,
    Extension = @Extension,
    Size = @Size,
    Width = @Width,
    Height = @Height,
    ContentType = @ContentType,
    Folder = @Folder,
    FolderID = @FolderID
   WHERE  FileId = @FileID

   SELECT @FileID

 END

 

 
New Post
1/7/2008 6:15 AM
 

Hello,

I had the same problem, but the solutions that where told above didn't work.

My solution was a problem with the file-rights:

Go on your webserver to your dnnwebsite folder.
1. Make a right-mouse click on the folder and choose 'properties' and go the the securtiy tab.

2. Make sure that the following users/rights are added to the list:

- IIS_[user] (in my case IIS_WPG) - Full control
- System - Full control
- Users - Read & Write access & special permission.

Good luck,

Greetings,
Koen Cornelissen

 
New Post
1/7/2008 7:57 AM
 

Above solutions apply to DNN 3.3x/4.3.x only, this has been solved in later versions of the framework.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...File upload permissionsFile upload permissions


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