upload and renaming pics

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/61121?pagenum=1
05 November 2025, 09:51

Topic


tribaliztic
upload and renaming pics
22 February 2006, 08:51


This is what I want:

- user click a link in the user profile
- user can upload 5 pics (via pop-up-window?)
- thumbs are created
- the pics are displayed automatically in profile

I can probably solve the display by renaming the pics to 1.jpg, 2.jpg and so on and have static links in the profile. But how do I upload the pics and rename them? I was thinking that maybe I could use the code for the file sharing mod, but how do I make it rename the pics? And the thumbnailing won't be done without any components I suppose? This is the code for uploading to the file sharing mod:
http://www.gotlandrace.se/tabort/pop_upload_new.txt<

 

Replies ...


tribaliztic
23 February 2006, 06:53


Noone? Zuel I KNOW that you're itching to solve this.. ;)
<
ILLHILL
23 February 2006, 20:24


This would be hot. It's definitely out of my league though, but I'm helping you up this in hopes
somebody comes along.
If I may suggest a size limit might come in handy especially with cameras nowadays going
way over 6 megapixels and with that images that go way over 2 mb per piece...not cool if
you have a couple hundred members all uploading their pics.
Greets, D<
tribaliztic
24 February 2006, 03:24


Well, then a auto resize would have to be used when before creating the thumbs or something. Also out of my league so I'll keep my fingers crossed that someone will have mercy =)
<
OneWayMule
24 February 2006, 04:09


I'd recommend using a component, which you'll need for resizing anyway. What components do you have available on your server?<
tribaliztic
24 February 2006, 04:11


well... Don't know really, I'll have a look if I can find out how to list all components... <
OneWayMule
24 February 2006, 04:14


This script might help. wink<
tribaliztic
24 February 2006, 04:29


This could be done in php also if anyone would like to =) Since it's in a pop-up that should be no problem afaik... <
tribaliztic
24 February 2006, 04:49


Originally posted by OneWayMule
This script might help. wink

Thanks! =)

Is it supposed to take really long time to run the script? It's been running since my last post and still nothing.. <
OneWayMule
24 February 2006, 05:26


Takes a few seconds usually... what server are you on?<
tribaliztic
24 February 2006, 05:37


win2k
seems like all asp-pages stopped working (I had to abort the script). txt-files show allright though. I'm just about to reboot the server and try again. <
tribaliztic
24 February 2006, 06:11


Nope, it's just not working on my server. I'm beginning to thing that my server don't like you, about half of your mods wont work on it =)
Try yourself here: http://grv2.gotlandrace.se/aspinfo.asp
<
OneWayMule
24 February 2006, 06:18


Looks like it... sad
Try removing the red lines from the following code in aspinfo.asp:
Code:
Call Display_Header()
Call Display_Server_Information()
Call Display_Application_Object()
Call Display_Request_Object()
Call Display_Response_Object()
Call Display_Server_Object()
Call Display_Session_Object()
Call Display_All_Components()
<
tribaliztic
24 February 2006, 06:22


removed! <
tribaliztic
24 February 2006, 06:34


I even renamed the file to aspinfo2.asp to be sure the file wasn't cached. What components would be of interest? <
OneWayMule
27 February 2006, 04:50


http://www.google.com/search?q=asp+upload+component

Any luck getting the script to run on the "I hate OneWayMule"-server? sad<
tribaliztic
28 February 2006, 04:30


Nope, wont' run =(
I _think_ I have persits upload component, but ain't sure.. <
tribaliztic
08 March 2006, 04:13


No luck on this yet.. I'm starting to think I have to use a php-script.. Should be possible to export variables for username and so on to a pop-up, or am I wrong? =)
<
tribaliztic
08 March 2006, 06:20


I've just installed the "abcupload component" so I know that one is available =)
I found a few asp upload scripts but none let me rename the files "on-the-fly", I might abandon that idea and just let the users name the files themselves... Though I can guarantee that some of them will forget to do that and everything will be messed up =)
<
tribaliztic
08 March 2006, 09:22


Now I've tried the "EZUpload" script, I can upload stuff with no problem. But when I tried to add the " & MemberID & " to the path it went berzerk. It can LIST the files, but when I try to upload files I get this:
Persits.Upload.1 error '800a0001'
unspecified error
ezupload2.asp, line 16

This is the code:
http://www.gotlandrace.se/tabort/ezupload2.txt
and this is the configfile
http://www.gotlandrace.se/tabort/config.txt
I've done a response.write on the paths as you can see and these is the results:
SKF_strDir = '/ezupload/20/'
SKF_strFolder = 'ezupload\20\'
and HTTP_HOST = 'grv2.gotlandrace.se'
where "20" is my memberid. The folder ezupload/20/images/ exist with read/write permissions for IUSR-user.
I think that's all info.. =)

<
Bassman
08 March 2006, 10:18


http://www.aspphotoresizer.com/

Can't you use this script...with a bit of a tweak. It runs super fast from 3 mb pics down to several kb's.<
tribaliztic
08 March 2006, 10:39


Yeah that would work with some tweaking, but for $75 I could get another script that does what I want without tweaks. I'm trying to fix this with a free script. Thanks anyway! <
tribaliztic
08 March 2006, 10:46


I found this info regarding my error but couldn't make it work anyways:
http://forums.brinkster.com/forummessage.asp?id=107372&Forum=22
<
tribaliztic
08 March 2006, 11:22


Ok, I excluded inc_header.asp and inc_footer.asp and the upload works. Now I just have to figure out how to make a popup window of this =)
<
tribaliztic
08 March 2006, 11:43


Yes, with a little copy&paste I managed to get a popup window with working upload.
Can anyone explain why it won't work when I have the inc_header.asp or inc_header_short.asp included? It don't really look like the rest of the page the way it is now =(
<
tribaliztic
08 March 2006, 12:23


I need help, again =)
(if anyone even read my monologue hehe..)

How can I make the paths use the MemberID-variable? I want it to be ezupload/20/ for me that have MemberID 20.
This is the code:
http://www.gotlandrace.se/tabort/ezupload.txt

It's not coded like snitz so I'm lost =)

I suppose these are the lines i need to change ("images" may be replaced with the MemberID):

SKF_strSaveFile = Request.ServerVariables("APPL_PHYSICAL_PATH")&SKF_strFolder&"images"

Upload.SaveVirtual SKF_strDir&"images"

File.SaveAsVirtual SKF_strDir&"images"&"/"&FName

<a target=""_blank"" href=""http://"&Request.ServerVariables("HTTP_HOST")&SKF_strDir&"images/"&objFileItem.Name & """>

<td width=""45%"" align=""center""><span style=""font-size:12px"">http://"&Replace(Request.ServerVariables("HTTP_HOST")&SKF_strDir&"images/"&objFileItem.Name," ","%20")&"</span></td>"

<
AnonJr
08 March 2006, 14:32


Don't know about the rest, but as for this:
Can anyone explain why it won't work when I have the inc_header.asp or inc_header_short.asp included? It don't really look like the rest of the page the way it is now =(
It has to do with the fact that you can't do a BinaryRead if you've already read from the server variables. Since (as far as I know) all upload components do a Request.BinaryRead it fails from the requests done in config.asp ... which is in all Snitz files.<
tribaliztic
09 March 2006, 03:15


But I can have config.asp included without problems, it's just the inc_header.asp that screw things up.. <
tribaliztic
09 March 2006, 05:28


Alittle further.. Just one little thingy left.. On line 29 in this file:
http://www.gotlandrace.se/tabort/ezuploadorig2.txt
I get this error:
' ''/ezupload2/'
Persits.Upload.1 fel '800a0005'

Det går inte att hitta sökvägen.

/ezuploadorig.asp, line 29


(Det går inte att hitta sökvägen = cannot find path)
<
AnonJr
09 March 2006, 08:27


Originally posted by tribaliztic
But I can have config.asp included without problems, it's just the inc_header.asp that screw things up..
Hmmm. Maybe it was inc_header.asp that did the read on the server variables... in particular it was the Request object that can't be called prior to a BinaryRead.
I'll have to look into it again and double-check myself ... it could have just been an issue with the pure scripting upload I was working with.<
tribaliztic
09 March 2006, 08:29


There _is_ an issue with the request object being called before the binary read and I suppose I can't get around it, hence my latest post regarding retrieving MemberID. I hope that will solve my problems. <
AnonJr
09 March 2006, 08:46


I've got to fix this problem for my work forum too... I'll let you know if I figure out anything. It'll probably just have to be a popup form with all the requisite info passed to it... just what I wanted to fight with during the first cup of coffee. =/<
tribaliztic
09 March 2006, 08:50


In my case I could solve it via Request.Querystring, but when the popup is reloaded that info is lost = MemberID = ""
=(
<
Zuel
11 March 2006, 12:52


How does the page reload?
You can simply add some code to set the query on the reload URL.
mID = Request.Query("MemberID")

<a href=""pop_up.asp?MemberID=" & mID & """>

Or a Meta Tag

"<meta http-equiv=""Refresh"" content=""1; URL=pop_up.asp?MemberID=" & mID & """>

Just a thought, but I had this working easily.
Other Information:
When doing an upload script, it will fail if you have a Request.Form anywhere preceeding that call. Very annoying to get around. I had to pass alot of information via Query to get information passes.<
tribaliztic
13 March 2006, 03:31


I tried that already Zuel but I couldn't make it work. It passed the member_id but I couldn't use it anyways.. <
tribaliztic
13 March 2006, 06:25


Now I have uploads working.. Then the delete-function stops working.. =(
I'm gonna find myself a high building to jump from soon..
On line 65 in this code:
http://www.gotlandrace.se/tabort/ezuploadorig.txt
I get an error about "file not found"
I think I have to use the "folder"-variable in that line, but how?
Also, if you look in the file I have hard-coded the number 20 (my MemberID) because I couldn't use the variable "MemberID". Why?
Hopefully awaiting some answers.. <
Zuel
13 March 2006, 10:50


Do a few checks to get the file name it is looking for.
Response.Write (SKF_strSaveFile & "\" & Request.Form(SKF_Item).Item)

This should tell you which file it is looking for. After you get it, try to access that file by URL. Also comment out the objFSO.DeleteFile so you can still get to it.
I see you have folder commented out. Does that function not work?
Could you post a test link? tongue
We will get this to work!<
tribaliztic
14 March 2006, 04:51


I don't really want to post a test link since I don't have the time to check if someone upload some strange stuff =) (even though the script should filter out bad files..). I can e-mail you a login (but I think you've got it since last time? =))
<
tribaliztic
14 March 2006, 04:53


Also the memberid is still hardcoded =(
<
tribaliztic
14 March 2006, 04:57


Originally posted by Zuel
Do a few checks to get the file name it is looking for.
Response.Write (SKF_strSaveFile & "\" & Request.Form(SKF_Item).Item)

This should tell you which file it is looking for. After you get it, try to access that file by URL. Also comment out the objFSO.DeleteFile so you can still get to it.
I see you have folder commented out. Does that function not work?
Could you post a test link? tongue
We will get this to work!

I tried that response.write but it didn't show anything. The file wasn't deleted either. I have to stuff the "folder"-variable into this link I suppose:

objFSO.DeleteFile SKF_strSaveFile&"\"&Request.Form(SKF_Item).Item

<
Zuel
14 March 2006, 09:01


If it doesn't show you anything then the variable has no value which is the problem.
Also what is a "inc" file? You have it on top. Config.inc.
If that is your config include, wouldn't it be something like incConfig.asp? It could be right, I dunno.<
tribaliztic
14 March 2006, 09:13


No, that's the config file for the "upload system". You've got mail btw =)<
tribaliztic
03 April 2006, 10:22


Still can't get this to work =(
And I was so close this time hehe.. I mean, how hard can it be? Too hard apparently but... <
tribaliztic
13 April 2006, 02:57


Zuel: Wouldn't it be kindof easy to mod your avatar mod (http://forum.snitz.com/forum/topic.asp?TOPIC_ID=60156) to do what I want? Sounds like it anyways..<
Zuel
13 April 2006, 09:16


Yours is on the verge of being complete. Send me an email of the current error and code text. I'll give it a run.
My mod has like 3k lines of code that hasn't nothing to do with you want, I think.<
tribaliztic
13 April 2006, 10:15


Well, I could do that =)
I just thought your mod was kindof what I need and it sure look better.. <
tribaliztic
18 April 2006, 10:19


Mail sent! =)
<
Zuel
18 April 2006, 11:19


You can't send me asp files through hotmail. You'll need to zip them.<
tribaliztic
19 April 2006, 06:20


Did you get them OK this time then? =) Didn't know hotmail blocked asp-files... <
tribaliztic
09 May 2006, 09:48


Okay, update:

It's possible to upload pics to the correct folder It's possible to list files in the correct folder
It's possible to delete files in the correct folder

The upload worked but when I fixed the listing after delete (a reload made the list show content from the wrong folder) the upload stopped working. Well, the upload is working but to the wrong folder and a reload after the upload show this error:

Current Folder:
Current Directory: /ezupload2/
Alt Current Directory: ezupload2\
Server.MapPath() fel 'ASP 0174 : 80004005'

Ogiltigt tecken i Path

/ezuploadorig.asp, line 44

Ett ogiltigt '/' eller '\' hittades i parametern Path för metoden MapPath.

Seems like the variable on line 10 isn't set in this file:
http://www.gotlandrace.se/tabort/uploaderror.txt

I guess the line isn't read after the reload? How to fix this? <
tribaliztic
09 May 2006, 10:47


I solved this! =)
I had to add the Folder-variable on a lot of places that I had missed =)
Now I can upload/delete/list files in folder uploadfolder/%memberid%/

Cool! <
brian33433
07 June 2006, 23:10


hey tribal

so now that you have it working can you share it with us?<
tribaliztic
14 June 2006, 04:47


Offcourse =)
The base code is from http://www.htmljunction.net/ezcodes.asp but I don't know how much is left from it. My forum is also heavily modified so I don't know if it will work for you but here's the code I use now:
http://www.gotlandrace.se/tabort/uploadmod.txt
I use this link to call the popup from my modified profile page:
"javascript:openWindow6('ezuploadpopup.asp?memid=" & ppMember_ID & "')"

Let me know if it's working on a clean copy and I might sum up some instructions... <
tribaliztic
14 June 2006, 04:51


Oh, and sorry for the text in swedish =)
I think you can figure out what's the meaning of things, if not just ask.. <
brian33433
14 June 2006, 16:29


well i can't get it to work, but i'm not real good with code, but if ya ever make it a mod would love to have it<
tribaliztic
15 June 2006, 02:57


What's the problem, do you get an error? <
© 2000-2021 Snitz™ Communications