| | @@ -346,11 +346,10 @@ |
| 346 | 346 | void attach_commit( |
| 347 | 347 | const char *zName, /* The filename of the attachment */ |
| 348 | 348 | const char *zTarget, /* The artifact hash to attach to */ |
| 349 | 349 | const char *aContent, /* The content of the attachment */ |
| 350 | 350 | int szContent, /* The length of the attachment */ |
| 351 | | - const char *zMimetype, /* Content mimetype or NULL */ |
| 352 | 351 | int needModerator, /* Moderate the attachment? */ |
| 353 | 352 | const char *zComment /* The comment for the attachment */ |
| 354 | 353 | ){ |
| 355 | 354 | Blob content; |
| 356 | 355 | Blob manifest; |
| | @@ -387,13 +386,10 @@ |
| 387 | 386 | if( n>0 ){ |
| 388 | 387 | blob_appendf(&manifest, "C %#F\n", n, zComment); |
| 389 | 388 | } |
| 390 | 389 | zDate = date_in_standard_format("now"); |
| 391 | 390 | blob_appendf(&manifest, "D %s\n", zDate); |
| 392 | | - if( zMimetype && 0!=zMimetype[0] ){ |
| 393 | | - blob_appendf(&manifest, "N %F\n", zMimetype); |
| 394 | | - } |
| 395 | 391 | blob_appendf(&manifest, "U %F\n", login_name()); |
| 396 | 392 | md5sum_blob(&manifest, &cksum); |
| 397 | 393 | blob_appendf(&manifest, "Z %b\n", &cksum); |
| 398 | 394 | attach_put(&manifest, rid, needModerator); |
| 399 | 395 | assert( blob_is_reset(&manifest) ); |
| | @@ -418,11 +414,10 @@ |
| 418 | 414 | const char *zTechNote = P("technote"); |
| 419 | 415 | const char *zFrom = P("from"); |
| 420 | 416 | const char *aContent = P("f"); |
| 421 | 417 | const char *zName = PD("f:filename","unknown"); |
| 422 | 418 | const char *zComment = PD("comment", ""); |
| 423 | | - const char *zMimetype = P("mimetype"); |
| 424 | 419 | const char *zTarget; |
| 425 | 420 | char * zTo = 0; |
| 426 | 421 | char *zTargetType = 0; |
| 427 | 422 | char *zExtraFree = 0; |
| 428 | 423 | int szContent = atoi(PD("f:bytes","0")); |
| | @@ -505,12 +500,11 @@ |
| 505 | 500 | /* Fall through and render form. */ |
| 506 | 501 | }else if( P("ok") && szContent>0 && (goodCaptcha = captcha_is_correct(0)) ){ |
| 507 | 502 | int needModerator = (zForumPost!=0 && forum_need_moderation()) || |
| 508 | 503 | (zTkt!=0 && ticket_need_moderation(0)) || |
| 509 | 504 | (zPage!=0 && wiki_need_moderation(0)); |
| 510 | | - attach_commit(zName, zTarget, aContent, szContent, zMimetype, |
| 511 | | - needModerator, zComment); |
| 505 | + attach_commit(zName, zTarget, aContent, szContent, needModerator, zComment); |
| 512 | 506 | cgi_redirect(zTo ? zTo : zFrom); |
| 513 | 507 | } |
| 514 | 508 | |
| 515 | 509 | style_set_current_feature("attach"); |
| 516 | 510 | style_header("Add Attachment"); |
| | @@ -1035,12 +1029,10 @@ |
| 1035 | 1029 | ** is to be made. The attachment will be |
| 1036 | 1030 | ** to the most recently modified tech note |
| 1037 | 1031 | ** with the specified timestamp. |
| 1038 | 1032 | ** -t|--technote TECHNOTE-ID Specifies the technote to be |
| 1039 | 1033 | ** updated by its technote id |
| 1040 | | -** --mimetype TYPE Optional mimetype of the attached |
| 1041 | | -** content |
| 1042 | 1034 | ** |
| 1043 | 1035 | ** One of PAGENAME, DATETIME or TECHNOTE-ID must be specified. |
| 1044 | 1036 | ** |
| 1045 | 1037 | ** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in |
| 1046 | 1038 | ** year-month-day form, it may be truncated, the "T" may be replaced by |
| | @@ -1061,23 +1053,16 @@ |
| 1061 | 1053 | |
| 1062 | 1054 | if( strncmp(g.argv[2],"add",n)==0 ){ |
| 1063 | 1055 | const char *zPageName = 0; /* Name of the wiki page to attach to */ |
| 1064 | 1056 | const char *zFile; /* Name of the file to be attached */ |
| 1065 | 1057 | const char *zETime; /* The name of the technote to attach to */ |
| 1066 | | - const char *zMimetype; /* --mimetype NAME */ |
| 1067 | 1058 | Manifest *pWiki = 0; /* Parsed wiki page content */ |
| 1068 | 1059 | char *zBody = 0; /* Wiki page content */ |
| 1069 | 1060 | int rid; |
| 1070 | 1061 | const char *zTarget; /* Target of the attachment */ |
| 1071 | 1062 | Blob content; /* The content of the attachment */ |
| 1072 | | - zMimetype = find_option("mimetype",0,1); |
| 1073 | 1063 | zETime = find_option("technote","t",1); |
| 1074 | | - /* |
| 1075 | | - FIXME/TODO (2026-06-02): adapt this to use |
| 1076 | | - attachment_target_type() and, when attaching to tech notes and |
| 1077 | | - forum posts, always attach to their root version. |
| 1078 | | - */ |
| 1079 | 1064 | if( !zETime ){ |
| 1080 | 1065 | if( g.argc!=5 ){ |
| 1081 | 1066 | usage("add PAGENAME FILENAME"); |
| 1082 | 1067 | } |
| 1083 | 1068 | zPageName = g.argv[3]; |
| | @@ -1120,11 +1105,10 @@ |
| 1120 | 1105 | attach_commit( |
| 1121 | 1106 | zFile, /* The filename of the attachment */ |
| 1122 | 1107 | zTarget, /* The artifact hash to attach to */ |
| 1123 | 1108 | blob_buffer(&content), /* The content of the attachment */ |
| 1124 | 1109 | blob_size(&content), /* The length of the attachment */ |
| 1125 | | - zMimetype, /* Mimetype */ |
| 1126 | 1110 | 0, /* No need to moderate the attachment */ |
| 1127 | 1111 | "" /* Empty attachment comment */ |
| 1128 | 1112 | ); |
| 1129 | 1113 | if( !zETime ){ |
| 1130 | 1114 | fossil_print("Attached %s to wiki page %s.\n", zFile, zPageName); |
| 1131 | 1115 | |