I want to download attachments from Bugzilla bugs management system. An example looks like this:
http://bugzilla.sudo.ws/attachment.cgi?id=255
http://bugzilla.sudo.ws/attachment.cgi?id=256 , etc.
As the result of each such request, files with various extensions and names can be downloaded, such as xxx.zip, yyy.jpg, zzz.doc , etc. Also, several files with the same file name (but different content) may correspond with different ids.
I want to automatically create file names for such files by using IDs as prefixes, for example:
255_xxx.zip
256_zzz.doc
...
276_zzz.doc (differs from 256_zzz.doc above).
Can I do it with Substutions functionality? When I trying to use a rule such as:
Apply to: filename
URL: http://bugzilla.sudo.ws/attachment.cgi?
Replace: attachment.cgi?id=*
With: *
then two sets of files are created: attachment files with original (unmodified) names, and html files with names 255,256 etc.
Additional=SkipDisposition
Download the Project and then export it to add proper extensions to these files.
Best regards,
Oleg Chernavin
MP Staff
attachment.cgi@id=255
attachment.cgi@id=256 etc.
with real types of attached files (for example .zip, .doc).
With substituions, it will create different file names according to substitution rules, such as:
255
256 etc.
again with real file types.
But I don't see how an export procedure can rename these files to required format such as:
255_xxxxxx.zip
256_yyy.doc
257_zzzz.jpg, etc.
I cannot see such option in Export window.
1. Without Additional=SkipDisposition option and with Substitution rule like replacing with *.html, two sets of files will be created: attached files with xxx.zip, yyyy.doc names, and html files with attachment numbers, such as 255.html, 256.html etc.
2. Now, a second pass will be required, which would rename attached file by adding a prefix of html file name, and also rewrite a link to attached file inside html file.
By the way, in my case an ability to browse downloaded site is not required, only properly named attached files are required.
Oleg.
1. I added Additional=SkipDisposition below project URL http://bugzilla.sudo.ws/attachment.cgi?id={:255..265} (I am using this link as a test example, the real web address is different).
2. I switched off Substitution rule.
3. I downloaded the project. Several files with names
attachment.cgi@id=255
...
attachment.cgi@id=265
were created in C:\download\bugzilla.sudo.ws folder.
4. I performed Export Files with checked "Use standard extensions for files with known file types" option.
After that, there are the same files as above in C:\Export\bugzilla.sudo.ws folder, no extensions and no prefixes were added.
Oleg.
Oleg.
https://bug680351.bmoattachments.org/attachment.cgi?id=554308
Offline Explorer contains protection against such cases, but I want to double-check it.
Thank you!
Oleg.
But the original problem is not about duplicates, it is about intelligent naming of any downloaded files (including duplicates).
Is it correct that such intelligent naming in this case (according to the description in my first message) is not possible?
Oleg.