Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

In MonkeyWrench.Database:

2009-06-04  Rolf Bjarne Kvinge  <RKvinge@novell.com>

	* DB.cs: Propagate the extension correctly on file
	upload to set the correct mime type.

In MonkeyWrench.Database/Extensions:
2009-06-04  Rolf Bjarne Kvinge  <RKvinge@novell.com>

	* DBWork_Extensions.cs: Propagate the extension correctly
	on file upload to set the mime type correctly.

svn path=/trunk/monkeywrench/; revision=135374
  • Loading branch information...
commit 7b9be3301f1977db804170c11235d69f32a29de0 1 parent 4bab8b6
Rolf Bjarne Kvinge rolfbjarne authored
5 MonkeyWrench.Database/ChangeLog
View
@@ -0,0 +1,5 @@
+2009-06-04 Rolf Bjarne Kvinge <RKvinge@novell.com>
+
+ * DB.cs: Propagate the extension correctly on file
+ upload to set the correct mime type.
+
4 MonkeyWrench.Database/DB.cs 100644 → 100755
View
@@ -247,7 +247,7 @@ public int GetLargeObjectSize (int oid)
/// </summary>
/// <param name="Filename"></param>
/// <returns></returns>
- public DBFile Upload (string Filename, bool hidden)
+ public DBFile Upload (string Filename, string extension, bool hidden)
{
IDbTransaction transaction = null;
LargeObjectManager manager;
@@ -307,7 +307,7 @@ public DBFile Upload (string Filename, bool hidden)
result.md5 = md5;
result.size = (int) filesize;
result.hidden = hidden;
- switch (Path.GetExtension (Filename).ToLower ()) {
+ switch (extension.ToLower ()) {
case ".log":
case ".txt":
case ".html":
5 MonkeyWrench.Database/Extensions/ChangeLog
View
@@ -0,0 +1,5 @@
+2009-06-04 Rolf Bjarne Kvinge <RKvinge@novell.com>
+
+ * DBWork_Extensions.cs: Propagate the extension correctly
+ on file upload to set the mime type correctly.
+
2  MonkeyWrench.Database/Extensions/DBWork_Extensions.cs 100644 → 100755
View
@@ -178,7 +178,7 @@ public static List<DBWorkFileView> GetFiles (this DBWork me, DB db)
public static DBFile AddFile (this DBWork me, DB db, string path, string filename, bool hidden)
{
- DBFile result = db.Upload (path, hidden);
+ DBFile result = db.Upload (path, Path.GetExtension (filename), hidden);
me.AddFile (db, result, path, filename, hidden);
return result;
}
Please sign in to comment.
Something went wrong with that request. Please try again.