Hi I have a task which uses a custom form which is part of a custom workflow. The form incorporates an asp fileUpload control to allow a user to browse for a local file which they can then select and it will be upload a file to a folder in a document
library. The first time this action is performed the folder in the document library will not exist so the code creates a folder and then uploads the file to it.
The problem I have is, the first time users try and upload a file the directory is created in the document library as expected, but then the user gets redirected to the standard SharePoint Access Denied page. If the user goes back to the task list,
then loads the task web page again, selects the same file and hits upload, then the file is uploaded fine. All subsequent file uploads work fine after that for all users. Users have Contribute permissions on the document library.
The code to do the upload is as follows. The task has a "CR Number" associated with it, which the directory in the doc library should be called. It uploads the file to a stream. Then gets the url of the web and works out the file
url and uploads it. The creation and checking of the folder in the doc library happens in the getDirUrl method.
/// Processes an uploaded file.
/// <param name="
View Complete Post