Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Upload mod ; check if file exists
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 23 April 2006 :  09:58:33  Show Profile  Visit MarcelG's Homepage  Reply with Quote
I've got a problem that I cannot seem to solve by myself....I need the help of someone who's got the correct skills.

Here's the scenario :
Simple file upload mechanism. A single file is selected via a form, to be uploaded.
Upon submit, the file is uploaded to the site, and stored in the folder site/uploaded/MemberID/filename

Now I want to enable some sort of intelligent feedback when someone tries to upload a file that already exists.
The feedback would then enable a warning message plus a (previously hidden) inputfield, which defines whether or not the file should be overwritten or renamed. Meanwhile the submit button would be disabled/hidden, until the choice whether to overwrite or rename was made.

Can someone make that for me ? I can spend up to US$ 75 on it (via PayPal). The base uploading script is already available, the only thing that needs to be modified is the piece described above.

Please contact me at marcel@oxle.com for more information.<

portfolio - linkshrinker - oxle - twitter

Zuel
Average Member

USA
540 Posts

Posted - 23 April 2006 :  12:30:26  Show Profile  Visit Zuel's Homepage  Reply with Quote
Avatar Mod has a class with that information. Has a checkbox for overwrite and informs user if file already exists. You probably save some cash and see what he did.<

My Completed Mods: News Mod | Zuel's Avatar Add-on
In Development: World of Warcraft Member Roster | [C# Based Forum]

Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.

MSN / E-Mail: ucyimDa_Ruler@Hotmail.com

Personal Bookmarks: How to work a DBS File
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 23 April 2006 :  13:11:09  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Zuel, thanks for the tip, but which avatar mod would that be ? I've got an old version (by Huw if I'm not mistaking) running on oxle.com<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 23 April 2006 :  14:19:29  Show Profile  Send ruirib a Yahoo! Message  Reply with Quote
I'd guess Zuel's own avatar mod . Check the mod W/Code forum, it's sitting at the top...<


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Zuel
Average Member

USA
540 Posts

Posted - 23 April 2006 :  14:36:52  Show Profile  Visit Zuel's Homepage  Reply with Quote
No no no,

RichardKinser's Mod. Sorry for not being specific. I didn't write the Upload Class, he did. You can find it on SnitzBitz, Hamlin converted it for 3.4. The base code on there would do you some good.<

My Completed Mods: News Mod | Zuel's Avatar Add-on
In Development: World of Warcraft Member Roster | [C# Based Forum]

Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.

MSN / E-Mail: ucyimDa_Ruler@Hotmail.com

Personal Bookmarks: How to work a DBS File
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 24 April 2006 :  08:13:45  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Oh, that one. Thanks! I'll investigate tonight ; saves me 75 bucks.<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 24 April 2006 :  17:41:01  Show Profile  Visit HuwR's Homepage  Reply with Quote
Did you find the info you needed MarcelG ?<
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 25 April 2006 :  01:23:48  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Not yet...haven't found the time to do that yet.
Will do so tonight.<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 02 May 2006 :  16:51:48  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Guys...I'm lost....okay, not actually lost as in not knowing where I am or unable to find my way back, but I'm lost as in I cannot figure out how to get this working.
The referal to the avatar upload mod brought me some other insights, but not the one I was looking for.
I've described it in more detail here: http://oxle.com/topic.asp?tid=3826 and I've decided to put an incentive with it for the person who can help me out

The theory is this:
If you upload a file to the site, you get a form with a browse button and a submit button.
If you - for instance - select the file C:\MY DOCUMENTS\TESTFILE.TXT, this and you press the submit button, the file gets uploaded to http://oxle.com/uploaded/<member id>/testfile.txt.
The <member id> is unique for every member.

So, in my case, uploading the file mypic.jpg to oxle would result in the following file: http://oxle.com/uploaded/18/mypic.jpg

Now, I want to improve this feature with the following extra feature.
If you want to upload mypic.jpg, and that file already exists, I'd like to see a warning, ánd I want to have the option to overwrite the file (default), or rename the file (non default option).

I want that warning ánd that choice before I hit the submit button, so without a page refresh.
If you think you have the solution for this, please read on.<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 02 May 2006 :  17:03:20  Show Profile  Visit HuwR's Homepage  Reply with Quote
it is not possible in the way that you want it to be for one simple reason, it is not possible to get the filename of the uploaded file until the form is posted, and for obvious security reasons this stuff should be done serverside.<
Go to Top of Page

Zuel
Average Member

USA
540 Posts

Posted - 02 May 2006 :  17:04:23  Show Profile  Visit Zuel's Homepage  Reply with Quote

<script language="JavaScript"><!-
function CheckForImage(URL) {
    var ThisImage = new Image();
    ThisImage .onError = alert('The following does not exist.  Please correct to continue.<br><br>" + URL');
    ThisImage .src     = URL;
}
//--></script>

<form name="upload">
    <input type="file" onChange="CheckForImage(document.upload.file.value);" name="file" />
    <input type="submit" value="submit"
</form>


Spaghetti code but it should do what you want. My javascript has gotten horrible within the past few months. I believe you got the uploading piece already.

You should be able to use javascript to grab just the file name then tag on your forumurl to the beginning. You should be able to create this javascript function dynamically to get all that, even the member id to concatinate the forum url + member id folder + image name.<

My Completed Mods: News Mod | Zuel's Avatar Add-on
In Development: World of Warcraft Member Roster | [C# Based Forum]

Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.

MSN / E-Mail: ucyimDa_Ruler@Hotmail.com

Personal Bookmarks: How to work a DBS File

Edited by - Zuel on 02 May 2006 17:07:33
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 02 May 2006 :  17:12:15  Show Profile  Visit HuwR's Homepage  Reply with Quote
that code won't work, document.upload.file.value is a path local to the clients machine not the server so you are checking the existance of a local file not a server file, javascript like that runs on the client.<
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 02 May 2006 :  17:14:10  Show Profile  Visit MarcelG's Homepage  Reply with Quote
quote:
Originally posted by HuwR

it is not possible in the way that you want it to be for one simple reason, it is not possible to get the filename of the uploaded file until the form is posted, and for obvious security reasons this stuff should be done serverside.

Huw, I understand what you're saying, but can you then explain me why it is working at storage.oxle.com ?
(use demouser/demouser to test it)
I think it's working because the browse button is not a 'real' browse button, but I'm not sure. My understanding of javascript is lacking here....

Zuel, your function would be applicable if it concerned only images.
I want it to work for both images as well as other documents.<

portfolio - linkshrinker - oxle - twitter

Edited by - MarcelG on 02 May 2006 17:17:01
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 02 May 2006 :  17:57:19  Show Profile  Visit HuwR's Homepage  Reply with Quote
the code on storage.oxle.com is php not asp<
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 02 May 2006 :  18:11:06  Show Profile  Visit AnonJr's Homepage  Reply with Quote
What's available in PHP that makes the difference?<
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 02 May 2006 :  18:40:16  Show Profile  Visit HuwR's Homepage  Reply with Quote
quote:
Originally posted by AnonJr

What's available in PHP that makes the difference?


the ability to check if a file exists on the server <
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07