Link to home
Start Free TrialLog in
Avatar of Pit76
Pit76Flag for Belgium

asked on

Search folders and subfolders and save file as JPG

Hi all,

Just got the assaignment to write a JavaScript the searches through a folder and his subfolders for a PSD file. When it finds one it needs to Save it as a JPG.

Is this possible and how to start with it? Haven't got a clue about JavaScript :( It will be good in VB script too it that is easier...

Grts
Avatar of HonorGod
HonorGod
Flag of United States of America image

That is going to be difficult, especially using any browser other than IE.
Only IE has ActiveX support that allows, or provides support for fileIO from JavaScript.

Most JavaScript implementations don't want scripts accessing the file system for security reasons.
Avatar of Pit76

ASKER

Is this possible in C#, to write a small app to perform this.

I guess I need to open a found .PSD file with PhotoShop and then save it as a JPG file.
How would I start with this? How to iterate through a folder and his subfolders?

Grts
ASKER CERTIFIED SOLUTION
Avatar of HonorGod
HonorGod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That's what the multi-part article uses...
Avatar of MrJesse34
MrJesse34

You don't need to open with photoshop, you can just save with a different extension.
Avatar of Pit76

ASKER

How can I save it with anonther extension? Will the file still work then cos  I tried just to rename it but that doesn't work, thet file can't open as a jpg then.

About the recursive function, does it search a folders su and sub sub folders too?

Never have done anything like this before..

Grts
A recursive function will call itself.

Say you have a directory, and you list the contents.
The contents will be files, and possibly more directories.
The routine used to list a directory contents, can be used recursively to process any directories that are encountered.

Does this make sense?

Sorry, I don't have answers for the other questions.
Thanks for the grade & points.

Good luck & have a great day