Author |
Topic |
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 23 April 2006 : 09:58:33
|
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
|
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
|
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 23 April 2006 : 13:11:09
|
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 |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
Zuel
Average Member
USA
540 Posts |
Posted - 23 April 2006 : 14:36:52
|
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
|
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 24 April 2006 : 17:41:01
|
Did you find the info you needed MarcelG ?< |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 02 May 2006 : 16:51:48
|
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 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 02 May 2006 : 17:03:20
|
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.< |
|
|
Zuel
Average Member
USA
540 Posts |
Posted - 02 May 2006 : 17:04:23
|
<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 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 02 May 2006 : 17:12:15
|
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.< |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 02 May 2006 : 17:14:10
|
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 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 02 May 2006 : 17:57:19
|
the code on storage.oxle.com is php not asp< |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 02 May 2006 : 18:11:06
|
What's available in PHP that makes the difference?< |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 02 May 2006 : 18:40:16
|
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 < |
|
|
Topic |
|