Ok, It seems that its really simple, We will use an input control in our markup with type="file" and runat="server" tag then from code beind
we will use the FileManager Class and pass the stream of the input control to the FileManager.Instance.AddFile as follows:
The Code Of The Submit Button
Private Sub btnUpload_Click(sender As Object, e As EventArgs) Handles btnUpload.Click
Dim User As New UserInfo
If Not IsNothing(Request.QueryString("UserID")) Then
Dim UID As Integer = CInt(Request.QueryString("UserID"))
User = UserController.Instance.GetUserById(PortalId, UID)
Else
User = UserController.Instance.GetCurrentUserInfo
End If
If (File1.PostedFile IsNot Nothing) AndAlso (File1.PostedFile.ContentLength > 0) Then
Try
FileManager.Instance.AddFile(FolderManager.Instance.GetUserFolder(User), File1.PostedFile.FileName, File1.PostedFile.InputStream, True)
DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, "File Uploaded Successfully", DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.GreenSuccess)
Catch ex As Exception
DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, "There Was An Error While Uploading The File - " & ex.Message, DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.RedError)
End Try
Else
DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, "Please Select a File To Upload.", DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.YellowWarning)
End If
End Sub
Hope It Helps